Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Multiple '01' enties possible in FD section?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Annie P

New User


Joined: 26 Jun 2006
Posts: 7

PostPosted: Thu Jun 29, 2006 4:20 pm    Post subject: Multiple '01' enties possible in FD section?
Reply with quote

Is Multiple '01' enties possible in FD section?
Back to top
View user's profile Send private message

Aji

New User


Joined: 03 Feb 2006
Posts: 53
Location: Mumbai

PostPosted: Thu Jun 29, 2006 4:48 pm    Post subject: Re: Multiple '01' enties possible in FD section?
Reply with quote

hi

The following way it is possible.

fd a-file.
01 print-rec pic x(132).
fd b-file.
01 b-rec.
02 c pic 99.

Regards

Aji Cherian
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Jun 29, 2006 5:08 pm    Post subject:
Reply with quote

Hi,
Multiple '01' entries is possible in FD

Eg:

FD A-FILE

01 WS-FIRST-RECORD PIC X(132).
05 WS-VAR-CHAR PIC X(32).
05 FILLER PIC X(100).

01 WS-SECOND-RECORD PIC X(132).
05 WS-VAR1-CHAR1 PIC X(20).
05 FILLER PIC X(112).
Based on the requirement you can read/write or whtever needed, use the record format

~Vamsi
Back to top
View user's profile Send private message
param_rajesh_2001
Warnings : 1

New User


Joined: 23 Jun 2006
Posts: 18
Location: Bangalore

PostPosted: Fri Jun 30, 2006 10:22 am    Post subject:
Reply with quote

Yes , it is possible . when you want to have diffrent record format . you can always delacre Mulitple 01 level records and accress them as per your requiremts ..
Back to top
View user's profile Send private message
Annie P

New User


Joined: 26 Jun 2006
Posts: 7

PostPosted: Fri Jun 30, 2006 2:31 pm    Post subject:
Reply with quote

thank u, for all ur outputs.
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Wed Jul 05, 2006 4:48 pm    Post subject:
Reply with quote

Hi,

I am not sure but, multiple 01 entries in a single FD is possible.

Okay,
At the time of writting a record into file, we spacify the 01 level items and that should work fine with files having multiple 01 level items.

But, when we use read statement, where will be the input record be available? Note that there are multiple 01 level items !
Back to top
View user's profile Send private message
manisha-s
Warnings : 1

New User


Joined: 22 May 2006
Posts: 13

PostPosted: Thu Jul 06, 2006 5:49 pm    Post subject: Re: Multiple '01' enties possible in FD section?
Reply with quote

multiple
01 entries are used for a given level indicator (FD, or SD) they
represent implicit redefinitions of the same area.

Regards
Manisha
Back to top
View user's profile Send private message
calspach

New User


Joined: 05 May 2006
Posts: 32
Location: USA

PostPosted: Fri Jul 07, 2006 12:01 am    Post subject:
Reply with quote

parikshit123 wrote:
But, when we use read statement, where will be the input record be available? Note that there are multiple 01 level items !

It will be available in any and all of the ten layouts.

It's best when doing so that you have a record-type field. I generally make it the first byte or two bytes. Then you know that any record with a 1 or 01 in the first two bytes uses your first record layout, 02 uses your second, etc.

I've written a program that actually had the input record redefined 10 times, 10 different layouts. Can be very handy for a billing program or something that has multiple lines of different info.
Back to top
View user's profile Send private message
lokesh vasanthi

New User


Joined: 19 Aug 2005
Posts: 17
Location: Chennai, India

PostPosted: Thu Jul 13, 2006 8:44 pm    Post subject: Re: Multiple '01' enties possible in FD section?
Reply with quote

Hi,

Multiple '01' entries possible in FD section

Take a situation if u have a file with header, detail, trailar record all are having different layouts. After reading the file the input record is in all the different layouts.Below is the code for ur understand

FD I-CUSTOMER-INPUT
BLOCK CONTAINS 0 RECORDS
RECORD IS VARYING IN SIZE FROM 252 TO 764
DEPENDING ON I-CUSTOMR-LENGTH
RECORDING V.
01 I-SLS-REC.
05 I-SLS-REC-TYP PIC X(01).
05 SLS-REST PIC X(763).
01 I-QRZ-REC.
05 I-QRZ-REC-TYPE PIC X.
05 FILLER PIC X(184).
05 I-QRZ-SOURCE-CD PIC XX.
05 FILLER PIC X(65).


READ I-CUSTOMER-INPUT
AT END SET WS-EOF TO TRUE
SET WS-FIRST-EOF TO TRUE
NOT AT END
ADD 1 TO WS-FIRST-READ-CNT
MOVE I-SLS-REC TO WS-SLS-REC
IF WS-SLS-REC-TYPE = 'T'
ADD 1 TO WS-RECON-T-CNT
END-IF
END-READ.

Regards,
Nanda
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Fri Jul 14, 2006 4:57 pm    Post subject: Re: Multiple '01' enties possible in FD section?
Reply with quote

nandakumar selvaraj wrote:
Hi,

Multiple '01' entries possible in FD section

Take a situation if u have a file with header, detail, trailar record all are having different layouts. After reading the file the input record is in all the different layouts.Below is the code for ur understand


Hi Nanda,

At my shop , this situation is genrally taken care by using REDEFINES in file layout rather than having multiple 01 entries.

I will try to test whether multiple 01 entries are possible in COBOL programs.icon_smile.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jul 15, 2006 6:45 am    Post subject:
Reply with quote

Hi,

You can't use redefines at the 01 level in the FD. You MUST use multiple 01s.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us