I was trying to understand 'SAME RECORD AREA Clause" and below is the link I referred.
https://www.ibm.com/support/knowledgece ... iossra.htm
In one of my COBOL program,we are using this clause as below.
FILE-CONTROL.
SELECT SEC-WKFL ASSIGN TO DA-R-SYS052.
SELECT SEC-FLWK ASSIGN TO DA-R-SYS052
ACCESS RANDOM NOMINAL KEY NOM.
SELECT T4-WKFL ASSIGN TO DA-R-SYS056.
SELECT T4-FLWK ASSIGN TO DA-R-SYS056
ACCESS RANDOM NOMINAL KEY MON.
I-O-CONTROL.
SAME RECORD AREA FOR T4-WKFL T4-FLWK
SAME RECORD AREA FOR SEC-WKFL SEC-FLWK.
FILE SECTION.
FD SEC-WKFL
RECORDING MODE F
LABEL RECORDS STANDARD
DATA RECORD IS S-WKREC.
01 S-WKREC.
03 FILLER PIC X(9).
03 S-CRSNR PIC X(4).
03 FILLER PIC XX.
03 S-SECNR PIC XX.
03 FILLER PIC X(63).
FD SEC-FLWK
RECORDING MODE F
LABEL RECORDS STANDARD
DATA RECORD IS S-RCDWK.
01 S-RCDWK.
03 FILLER PIC X(80).
060-WRITE-WKFL.
WRITE S-WKREC FROM SEC-RCDIN.
SELECT SEC-WKFL ASSIGN TO DA-R-SYS052.
SELECT SEC-FLWK ASSIGN TO DA-R-SYS052
ACCESS RANDOM NOMINAL KEY NOM.
SELECT T4-WKFL ASSIGN TO DA-R-SYS056.
SELECT T4-FLWK ASSIGN TO DA-R-SYS056
ACCESS RANDOM NOMINAL KEY MON.
I-O-CONTROL.
SAME RECORD AREA FOR T4-WKFL T4-FLWK
SAME RECORD AREA FOR SEC-WKFL SEC-FLWK.
FILE SECTION.
FD SEC-WKFL
RECORDING MODE F
LABEL RECORDS STANDARD
DATA RECORD IS S-WKREC.
01 S-WKREC.
03 FILLER PIC X(9).
03 S-CRSNR PIC X(4).
03 FILLER PIC XX.
03 S-SECNR PIC XX.
03 FILLER PIC X(63).
FD SEC-FLWK
RECORDING MODE F
LABEL RECORDS STANDARD
DATA RECORD IS S-RCDWK.
01 S-RCDWK.
03 FILLER PIC X(80).
060-WRITE-WKFL.
WRITE S-WKREC FROM SEC-RCDIN.
With the above WRITE statement, will S-RCDWK also have the same value as s-WKREC ?
I was advised by the experts here ibm-cobol/topic11463.html that I would need to convert the direct access file to either KSDS or RRDS.I'm converting it to RRDS.
Here both SEC-WKFL & SEC-FLWK refer to the same DD.Since I need to convert it to VSAM,I split it such that both the files will have individual DD statements in JCL. SEC-WKFL will be a QSAM file and SEC-FLWK will be a RRDS file.
Now will SAME RECORD AREA behave in a different manner.When I was testing it,it looks like it did.
Can someone please explain me SAME RECORD AREA clause in more detail ? I'm not very sure if I explained the issue well here.