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

few doubts in cobol read clause


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

New User


Joined: 25 Nov 2005
Posts: 18
Location: uae

PostPosted: Thu May 25, 2006 4:54 pm
Reply with quote

hi i have few queries in cobol read.
1. my file is variable length record and i have 4 01 levels. and i want to read that seq. and within these 4 recs there are sort keys could u tell me how to read this and check the sort key and and read the next record.

hope to get a reply soon.
thanks in advance
aklima
Back to top
View user's profile Send private message
gskulkarni

New User


Joined: 01 Mar 2006
Posts: 70

PostPosted: Thu May 25, 2006 5:01 pm
Reply with quote

You have a variable length file and you have four 01 level record formats.
I am guessin gthat the file can contain records of one of those 4 record layouts given by four 01 levels.

See the syntax for your reference.

Code:
FD  AUTO-OUTPUT-FILE
    RECORDING MODE IS V
    RECORD IS VARYING IN SIZE FROM 1056 TO 3900 CHARACTERS
                      DEPENDING ON WORK-LENGTH
    BLOCK CONTAINS 0 RECORDS
    DATA RECORD IS AUTO-RECORD.

01  AUTO-RECORD1.
    05  FILLER                       PIC X(3900).
01  AUTO-RECORD2.
    05  FILLER                       PIC X(1700).
01  AUTO-RECORD.
    05  FILLER                       PIC X(1056).



and while reading you can use READ auto file into 'any one of those 4 record types'
Back to top
View user's profile Send private message
umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Fri May 26, 2006 11:17 am
Reply with quote

Could you please explain your query in detail?
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Thu Jun 01, 2006 5:28 pm
Reply with quote

I think you have variable length records in four layouts. In such case generally the first byte will have a record identifier based on which you can process the records. It would be easier to answer your question if you supply the copybook of your file
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jun 03, 2006 4:26 am
Reply with quote

Well Umesh, you went and did it - asked Aklima to answer a ques about his problem. Now we'll never hear from him again!
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top