IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

multiple '01' levels in FD entry in file section.....


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mohnish

New User


Joined: 22 Sep 2006
Posts: 4

PostPosted: Sat Dec 16, 2006 11:44 am
Reply with quote

hi all...
what actually does multiple 01 levels in a FD entry of a file section signifies
...
i just learnt that the latter 01 level implicitly redefines the former 01 level....
in that case if the layout of both 01 levels are different but the total sum of fields is same...
then if we are trying to read the file ,in which 01 level it would be read....

i hope i made my question clear!!
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Sat Dec 16, 2006 11:52 am
Reply with quote

When more than one level-01 entry is written subordinate to an FD entry, a condition known as implicit redefinition occurs. That is, the second level-01 entry implicitly redefines the storage allotted for the first entry. In such level-01 entries, the REDEFINES clause must not be specified.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Dec 16, 2006 5:06 pm
Reply with quote

Multiple 01 levels on input all get the data.
They can be of different lengths, that's one way to define variable length files.
On output, the 01 written defines the length of the output record.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Dec 18, 2006 10:48 am
Reply with quote

Hi Mohnish

You can have any of the 01 levels for reading as per your requirement.Each one would fetch you data in different formats as defined in the FD section

Thanks
Arun
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 19, 2006 3:38 am
Reply with quote

Hello,

If an existing file has multiple level 01s, each most likely has some kind of record identifier (i.e. REC-CODE or REC-TYPE). Once a record is read from the file the record identifier is checked so the program can execute the proper logic for "that" record.

Reading a record occurs on each read of the file - knowing how to process each format is up to the program.

If you create a file with different record layouts (01s in the FD), be sure to include a record type in the same position in each record. The field(s) the file is sequenced by are commonly the first field(s) in each record and the next byte or 2 the record type.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top