Subject: | |
From: | |
Reply To: | |
Date: | Thu, 19 Dec 2002 12:18:24 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
One solution.
I copy the file to a file of known length prior to the COBOL process.
Kent Wallace
>>> <[log in to unmask]> 12/19/02 07:49AM >>>
I need some help with Cobol...
I am writing a program that is going to read in data
files. However, I the record size (ie; width) of the
data files will vary from run to run. How can I ensure
that my program can cope with this variable record
width.
For example, none of my data files will exceed
1200bytes, so I have initially defined my FD area
thus...* Identify the external files to be used
SELECT F1-INFILEA ASSIGN TO "INFILEA".
SELECT F2-INFILEB ASSIGN TO "INFILEB".
SELECT F3-OUTFILE ASSIGN TO "OUTFILE".
DATA DIVISION.
FILE SECTION.
* Define the layout of the INFILEA input file
* INFILEA
FD F1-INFILEA.
01 F1-RECORD PIC X(1200).
* Define the layout of the INFILEB input file
* INFILEB
FD F2-INFILEB.
01 F2-RECORD PIC X(1200).
...however, when I read in a datafile, say, that is
702bytes wide, my program gives a file error tombstone
complaining about the difference of 702 to my defined
1200.
Can this situation be resolved with something as simple
as a file equation? I've tried a few, but without
success.
All help gratefully received.
David.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|