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

FD entry and the 01 level following it


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

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Sep 18, 2007 11:44 am
Reply with quote

FD entry is usually coded in the data division for every file that is used in the program. Also a record structure is defined which acts as a buffer to hold the read data.

In one of modules i found 2 01 levels (record structures) following the FD entry. What is the use of coding 2 similar (In my case both the 01 levels are same expect the record name)record structures.

Will both the record buffers get populated when a record is read from the file? Please throw some light on this.
Back to top
View user's profile Send private message
kgumraj2

New User


Joined: 01 Aug 2007
Posts: 42
Location: Hyderabad

PostPosted: Tue Sep 18, 2007 11:46 am
Reply with quote

Hi,

Check the files are FB or VB, I feel it is VB (Varing block)
Let us know what you have found, thanks
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Sep 18, 2007 11:47 am
Reply with quote

Aaru,

Quote:
In one of modules i found 2 01 levels (record structures) following the FD entry. What is the use of coding 2 similar (In my case both the 01 levels are same expect the record name)record structures.


Generally for VB file we code like this. The second 01 group is nothing but the redefine of first 01 variable. It is an implicit redef.
Back to top
View user's profile Send private message
snehalpatel

New User


Joined: 13 Sep 2007
Posts: 37
Location: India

PostPosted: Tue Sep 18, 2007 11:56 am
Reply with quote

Aaru wrote:
FD entry is usually coded in the data division for every file that is used in the program. Also a record structure is defined which acts as a buffer to hold the read data.

In one of modules i found 2 01 levels (record structures) following the FD entry. What is the use of coding 2 similar (In my case both the 01 levels are same expect the record name)record structures.

Will both the record buffers get populated when a record is read from the file? Please throw some light on this.



Hi

Let me give one Example of VB file used as O/P file

FD OUT-PUT-FEED-FILE
RECORDING MODE IS V
RECORD CONTAINS 42 TO 205 CHARACTERS
BLOCK CONTAINS 0 RECORDS
LABEL RECORD ARE STANDARD
DATA RECORDS ARE REC-A
REC-B
REC-C
01 REC-A PIC X(42)
01 REC-B PIC X(125)
01 REC-C PIC X(205).


Here OUT-PUT-FEED-FILE file is Variable file.
In JCl it would be decalred as


//OUTFEED DD DSN=FILE NAME
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(100,50),RLSE),UNIT=SYSDA,
// DCB=(LRECL=209,RECFM=VB,BLKSIZE=0)

NOTE LRECL IS 209 it is max rec length +4 bytes ..
205+4 = 209

The same file can be seen with different layouts ..
Correct me if i am wrong ..

About reading a VB file i have no Idea ..
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Sep 18, 2007 1:40 pm
Reply with quote

Aaru wrote:
FD entry is usually coded in the data division for every file that is used in the program. Also a record structure is defined which acts as a buffer to hold the read data.
Actually the 01s are not buffers, but dsects, like 01s in linkage section, whose addressability is set into the actual I/O buffer and for each read moved to the next record in the actual block.
If the 01 lengths are different, the file must be defined variable but if they are the same length, the file could be either variable or fixed.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Sep 18, 2007 1:47 pm
Reply with quote

Quote:

Check the files are FB or VB, I feel it is VB (Varing block)
Let us know what you have found, thanks


Yep, It is a variable block file.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Sep 18, 2007 1:56 pm
Reply with quote

Thanks a lot for the details.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Tue Sep 18, 2007 2:46 pm
Reply with quote

FD section can have Multiple 01 levels with the same length (FB) or different length(VB). As Murali said, it is an implicit redefine.
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 load to DB2 with column level ... DB2 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts JPM Reports for each DB2 V12 Function... DB2 0
No new posts Program level statistics CICS 6
No new posts Multiple Entry PL/I & Assembler 5
Search our Forums:

Back to Top