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

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Mon Jul 09, 2007 1:59 pm
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: 1287
Location: Chennai, India

PostPosted: Mon Jul 09, 2007 2:23 pm
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
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: 148
Location: Ottawa Canada

PostPosted: Mon Jul 09, 2007 9:17 pm
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

Moderator Emeritus


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

PostPosted: Mon Jul 09, 2007 9:42 pm
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

Superior Member


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

PostPosted: Wed Jul 11, 2007 6:49 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top