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
 

 

Read a sequential file and I don't know the record format

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

New User


Joined: 05 Jul 2007
Posts: 2
Location: Germany

PostPosted: Mon Jul 09, 2007 1:52 pm    Post subject: Read a sequential file and I don't know the record format
Reply with quote

Hallo,
we have COBOL2 and the language is COBOL/370.

My problem is: I have to read a sequential file
and I don?t know the record format (fixed or variable?) and the record length.

Is it possible to solve these problem? And how?

If possible, give me your answer in german.

Thank you very much

COBOL-Willi from Germany
Back to top
View user's profile Send private message

murmohk1

Senior Member


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

PostPosted: Mon Jul 09, 2007 1:59 pm    Post subject:
Reply with quote

Willi,

Quote:
I don?t know the record format (fixed or variable?) and the record length.


I feel you can get these details from 3.4.
Back to top
View user's profile Send private message
Aaru

Senior Member


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

PostPosted: Mon Jul 09, 2007 2:23 pm    Post subject: Re: Read a sequential file and I don't know the record forma
Reply with quote

Yes, do a 3.4 and then S/I to get the record format

Record format . . . : FB

FB - Fixed Block
VB - Variable block

Use these details in the DATA DIVISION in the cobol program.
Back to top
View user's profile Send private message
COBOL-Willi

New User


Joined: 05 Jul 2007
Posts: 2
Location: Germany

PostPosted: Mon Jul 09, 2007 8:50 pm    Post subject: 3.4 not possible
Reply with quote

because I get the file from a lot of other jobs.

So it is not possible, to look to3.4.

Thank you

COBOL-Willi
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Mon Jul 09, 2007 9:17 pm    Post subject:
Reply with quote

COBOL-Willi,

Here's a vague approach - perhaps others can flesh it out in more detail.

Copy the file with UNKNOWN attributes to a file that has KNOWN attributes and process the new file with your COBOL program. Your new file could be a variable length field with max rec size of 32K.

Use a utility to copy the file. Or perhaps a REXX program.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Jul 09, 2007 9:42 pm    Post subject:
Reply with quote

Hello,

Please do not request this
Quote:
If possible, give me your answer in german.

Topic posts and replies should be in English to keep the forums consistent.

Most participants do not read/speak German.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jul 11, 2007 6:49 pm    Post subject: Re: Read a sequential file and I don't know the record forma
Reply with quote

Hi,
COBOL-Willi wrote:
My problem is: I have to read a sequential file and I don?t know the record format (fixed or variable?) and the record length.

COBOL does not bother about the record format of the file to be read whether input-file is a QSAM (aka sequentilal-file) or VSAM file.

If you are thinking about the RECORDING MODE clause, then in COBOL this clause is an optional clause in a file description entry and for VSAM files, this clause is ignored. So in any case you can go ahead with your program.

Further, in JCL, you've no need to give the DCB parameter of input-file. I didn't understand why do you need to know whether the file is FB or VB for reading it in COBOL, if something specific is there, please let me know.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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