Hello,
I am writing some records in a file.
The file is declared as follows:
The data record structure is as folows:
I first write the header record in the file, and then the data records.
In the JCL, the file has been defined as:
//CUSTFILE DD DSN=B96543.TEST.XXX2,
// RECFM=FB,BLKSIZE=800,LRECL=80,
// SPACE=(TRK,(3,30),RLSE),UNIT=DISK,DISP=(NEW,CATLG,DELETE)
When I see the output file, I see that the data records are being written correctly.
But after every 50th record I can see that the header is getting overlapped.
I know that half of the problem is that I should move spaces to the accounts-record after the write so that the filler does have spaces.
However, I would like to understand what am I missing here.
I am not sure why is this happening. Has anybody here experienced this problem before?
This is the closest I could find it on internet: Link
I am writing some records in a file.
The file is declared as follows:
Code:
input-output section.
file-control.
select CUSTFILE assign to CUSTFILE
organization is sequential
file status is ws-cust-status.
data division.
file section.
FD CUSTFILE.
01 customer-rec.
-INC RHBAL03C
working-storage section.
01 header-rec.
10 rec-id pic x(011) value spaces.
10 offbal-date pic x(008) value spaces.
10 prod-system-id pic x(008) value spaces.
10 rec-content pic x(016) value spaces.
10 length-chk pic x(037) value spaces.
The data record structure is as folows:
Code:
/* Eksternal Customer Records to GFS/KRS - Length : 80
3 Account-Id pic x(014).
/* HandelsId
3 Customer-Id pic x(010).
/* KNID
3 Rolle-id pic x(002).
/* Rolle-id
3 filler pic x(054) value spaces.
/* KobSalg
I first write the header record in the file, and then the data records.
Code:
move 'STARTRECORD'
to rec-id in header-rec
move prokort-date
to offbal-date in header-rec
move 'RDOFFER'
to prod-system-id in header-rec
move 'OFFBALCUSTREC'
to rec-content in header-rec
move length of customer-rec
to length-chk in header-rec
write customer-rec from header-rec
initialize header-rec
perform varying i from 1 by 1 until i > idx1
perform varying j from 1 by 1 until( j >= 20 or
rolle-nr in ws-accounts-rec(i, j)
= spaces)
add +1 to idx3
move account-id in ws-accounts-rec(i)
to account-id in customer-rec
move customer-id2 in ws-accounts-rec(i, j)
to customer-id in customer-rec
move rolle-nr in ws-accounts-rec(i, j)
to rolle-id in customer-rec
write customer-rec
initialize customer-rec
end-perform
end-perform
In the JCL, the file has been defined as:
//CUSTFILE DD DSN=B96543.TEST.XXX2,
// RECFM=FB,BLKSIZE=800,LRECL=80,
// SPACE=(TRK,(3,30),RLSE),UNIT=DISK,DISP=(NEW,CATLG,DELETE)
When I see the output file, I see that the data records are being written correctly.
But after every 50th record I can see that the header is getting overlapped.
I know that half of the problem is that I should move spaces to the accounts-record after the write so that the filler does have spaces.
However, I would like to understand what am I missing here.
I am not sure why is this happening. Has anybody here experienced this problem before?
This is the closest I could find it on internet: Link