File def'n-problem with different records layouts



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

File def'n-problem with different records layouts

Postby ralph » Tue Oct 26, 2021 10:47 pm

This is an old COBOL pgm that I alm trying to change the input file in. However, the program won't accept my multiple file layouts under FD of my input file. Not sure why? Any ideas? This is 1 file with multiple sequential records. There is typically a couple of leading records both with different information, multiple detail records with same information per employee, then trailing record with totals.
ralph
 
Posts: 2
Joined: Tue Oct 26, 2021 10:41 pm
Has thanked: 1 time
Been thanked: 0 time

Re: File def'n-problem with different records layouts

Postby Robert Sample » Wed Oct 27, 2021 12:27 am

However, the program won't accept my multiple file layouts under FD of my input file
What does this even mean? You can have multiple 01 levels under the FD but what are "multiple file layouts"? Other things that would be nice to know:
- is the file fixed length or variable length? If variable length, what is the minimum and maximum record lengths and how does COBOL know about them?
- what error messages are you getting -- compile time, presumably, but what is the compiler / computer telling you?
- if the file is fixed length, have you verified that what you are adding are all that same length?
- what version of COBOL are you using?

These users thanked the author Robert Sample for the post:
ralph (Wed Oct 27, 2021 2:10 am)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: File def'n-problem with different records layouts

Postby ralph » Wed Oct 27, 2021 1:42 am

Thank you Robert for responding and nice to meet you. This COBOL version is probably very old, this business went to RPG a long time ago.
This input file has records, 1ST 1 need to capture the data, then next line need parts of the data, then next line repeats itself & need info from each one of those.
This input file is fixed length and I HAVE 3 ‘01’ levels under the FD xxx-file.

01 A-RECORD.
05 FILLER PIC X(94).
01 5-RECORD.
fields . . . FIELD VALUES ADD UP TO 94
01 6-RECORD.
fields . . . FIELDS VALUES ADD UP TO 94
The original pgm has different values in 5-RECORD as it was based on a different input file. I've changed the fields to suit the new file.
I’m running the pgm in debug, break at the reads on this input file. Shows values in A-RECORD & 6-RECORD. But an eval on 5-RECORD says “Identifier does not exist”. I'm lost.
ralph
 
Posts: 2
Joined: Tue Oct 26, 2021 10:41 pm
Has thanked: 1 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post