View previous topic :: View next topic
|
Author |
Message |
COBOL-Willi
New User
Joined: 05 Jul 2007 Posts: 2 Location: Germany
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
COBOL-Willi
New User
Joined: 05 Jul 2007 Posts: 2 Location: Germany
|
|
|
|
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 |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
|