COBOL for AIX

power-server-operatingsystems.png

Operating Systems

The core of your mission-critical workloads: AIX, IBM i, and Enterprise Linux

power-ISV-Solutions1.png

ISV Solutions

Stay up to date with key capabilities running on POWER such as SAP

Business Continuity

Learn how to keep critical processes running and adapt quickly with PowerHA

power-infrastructure-security.png

Power Security

Protect your most sensitive data anywhere in your hybrid cloud

Virtualization

Check here for virtualization and management needs: HMC & CMC, PowerVC, and PowerVM

Open Source

Join our open source efforts within the IBM Power Systems portfolio

Enterprise Infrastructure as a Service

Achieve business growth with agility and flexibility with our enterprise IaaS in Power Virtual Server

Programming Languages

The hub for Programming Languages

FS=39 when opening a varying length RSD record file after moving to COBOL for AIX, V5.1

By Basil Kanneth posted Tue August 11, 2020 10:12 AM

  

Summary:
Clients who have COBOL for AIX programs that make use of varying length record format in RSD, but have coded it as "Fixed (ie F)" might encounter a FS=39 issue when moving to COBOL for AIX, V5.1.

eg:
1. FILE-CONTROL.
SELCT FILE1 ASSIGN TO FILE1
ORGANIZATION IS SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS FS.
FD FILE1 RECORDING MODE F.
01 SRC-REC PIC X(90).

2. FILE1 DATA
The file record length is 89 bytes.

Problem Description:
The above example, would succeed to run pre-COBOL for AIX, V5.1.

However, starting from V5.1, for RSD files, we start checking the the minimum and maximum record lengths when opening a file.
This change was introduced to be more consistent with other filesystems such as STL, SdU, SFS.

Problem Resolution:
In the above example, since the actual record length is varying (eg 89 instead of the expected 90), starting from V5.1 you need to explicitly state that the records are varying in length when you define the FD in the source code:
ie Change:
FD FILE1 RECORDING MODE F.

to

FD FILE1
RECORDING MODE IS V
RECORD IS VARYING FROM 1 TO 90 CHARACTERS.

If the "RECORDING MODE IS V" is not specified, the compiler assumes "RECORDING MODE IS F" ie fixed.
F => That means all the records have to be the same length
V => That means the records can vary in length.

More info can be found here:
https://www.ibm.com/support/knowledgecenter/SS6SGM_5.1.0/com.ibm.cobol51.aix.doc/PGandLR/ref/rlfdermc.html

0 comments
1 view

Permalink