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

Multiple '01' enties possible in FD section?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top