This is a multi-part message in MIME format.
------=_NextPart_000_0051_01C2A76B.3F39FF60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
David, hope this helps!
*.. Output file for records going TO 635902 line (VAP1)
FD NTIV59B
RECORD VARYING FROM 10 TO 800
DEPENDING ON REC-LNGTH.
01 NTIV59B-REC PIC X(800).=20
WHERE REC-LNGTH IS S9(4) COMP. Works every time
Linda Hughes
[log in to unmask]
<[log in to unmask]> wrote in message =
news:3e021795$1@skycache-news.fidnet.com...
> I need some help with Cobol...
>=20
> 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.
>=20
> 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
>=20
> SELECT F1-INFILEA ASSIGN TO "INFILEA".
> SELECT F2-INFILEB ASSIGN TO "INFILEB".
> SELECT F3-OUTFILE ASSIGN TO "OUTFILE".
>=20
> DATA DIVISION.
> FILE SECTION.
>=20
> * Define the layout of the INFILEA input file
>=20
> * INFILEA
> FD F1-INFILEA.
> 01 F1-RECORD PIC X(1200).
>=20
> * Define the layout of the INFILEB input file
>=20
> * INFILEB
> FD F2-INFILEB.
> 01 F2-RECORD PIC X(1200).
>=20
>=20
> ...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.
>=20
> Can this situation be resolved with something as simple
> as a file equation? I've tried a few, but without
> success.
>=20
> All help gratefully received.
>=20
> David.
>=20
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
------=_NextPart_000_0051_01C2A76B.3F39FF60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<P><FONT face=3DArial size=3D2>David, hope this helps!</FONT></P>
<P><FONT face=3DArial size=3D1>*.. Output file for records going TO =
635902 line=20
(VAP1)</FONT></P>
<P><FONT face=3DArial size=3D1>FD NTIV59B</FONT></P>
<P><FONT face=3DArial =
size=3D1> RECORD=20
VARYING FROM 10 TO 800</FONT></P>
<P><FONT face=3DArial =
size=3D1> DEPENDING=20
ON REC-LNGTH.</FONT></P>
<P><FONT face=3DArial size=3D1>01 NTIV59B-REC PIC X(800). </FONT></P>
<P><FONT face=3DArial size=3D2>WHERE <FONT size=3D1>REC-LNGTH =
</FONT><FONT size=3D2>IS=20
S9(4) COMP. Works every time</FONT></FONT></P>
<P><FONT face=3DArial size=3D2>Linda Hughes</FONT></P>
<P><FONT face=3DArial size=3D2><A=20
href=3D"mailto:[log in to unmask]">[log in to unmask]</A></FO=
NT></P>
<P><FONT face=3DArial size=3D2></FONT> </P></DIV>
<DIV><FONT face=3DArial size=3D2><</FONT><A=20
href=3D"mailto:[log in to unmask]"><FONT face=3DArial=20
size=3D2>[log in to unmask]</FONT></A><FONT face=3DArial =
size=3D2>> wrote in=20
message </FONT><A =
href=3D"news:[log in to unmask]"><FONT=20
face=3DArial =
size=3D2>news:[log in to unmask]</FONT></A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> I =
need some help=20
with Cobol...<BR>> <BR>> I am writing a program that is going to =
read in=20
data<BR>> files. However, I the record size (ie; width) of =
the<BR>> data=20
files will vary from run to run. How can I ensure<BR>> that my =
program can=20
cope with this variable record<BR>> width.<BR>> <BR>> For =
example, none=20
of my data files will exceed<BR>> 1200bytes, so I have initially =
defined my=20
FD area<BR>> thus...* Identify the external files to be used<BR>> =
<BR>>=20
SELECT F1-INFILEA ASSIGN TO "INFILEA".<BR>> SELECT =
F2-INFILEB=20
ASSIGN TO "INFILEB".<BR>> SELECT F3-OUTFILE ASSIGN TO=20
"OUTFILE".<BR>> <BR>> DATA DIVISION.<BR>> FILE=20
SECTION.<BR>> <BR>> * Define the layout of the INFILEA input =
file<BR>>=20
<BR>> * INFILEA<BR>> FD F1-INFILEA.<BR>> =
01 =20
F1-RECORD &nbs=
p; =20
PIC X(1200).<BR>> <BR>> * Define the layout of the INFILEB input=20
file<BR>> <BR>> * INFILEB<BR>> FD =
F2-INFILEB.<BR>>=20
01 =20
F2-RECORD &nbs=
p; =20
PIC X(1200).<BR>> <BR>> <BR>> ...however, when I read in a =
datafile,=20
say, that is<BR>> 702bytes wide, my program gives a file error=20
tombstone<BR>> complaining about the difference of 702 to my =
defined<BR>>=20
1200.<BR>> <BR>> Can this situation be resolved with something as=20
simple<BR>> as a file equation? I've tried a few, but without<BR>> =
success.<BR>> <BR>> All help gratefully received.<BR>> <BR>> =
David.<BR>> <BR>> * To join/leave the list, search archives, =
change list=20
settings, *<BR>> * etc., please visit </FONT><A=20
href=3D"http://raven.utc.edu/archives/hp3000-l.html"><FONT face=3DArial=20
size=3D2>http://raven.utc.edu/archives/hp3000-l.html</FONT></A><FONT =
face=3DArial=20
size=3D2> *<BR>> </FONT></BODY></HTML>
------=_NextPart_000_0051_01C2A76B.3F39FF60--
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|