HP3000-L Archives

December 2002, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Linda Hughes <[log in to unmask]>
Reply To:
Linda Hughes <[log in to unmask]>
Date:
Thu, 19 Dec 2002 13:31:59 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (172 lines)
 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RECORD=20
VARYING FROM 10 TO 800</FONT></P>
<P><FONT face=3DArial =
size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;</P></DIV>
<DIV><FONT face=3DArial size=3D2>&lt;</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>&gt; 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>&gt; I =
need some help=20
with Cobol...<BR>&gt; <BR>&gt; I am writing a program that is going to =
read in=20
data<BR>&gt; files. However, I the record size (ie; width) of =
the<BR>&gt; data=20
files will vary from run to run. How can I ensure<BR>&gt; that my =
program can=20
cope with this variable record<BR>&gt; width.<BR>&gt; <BR>&gt; For =
example, none=20
of my data files will exceed<BR>&gt; 1200bytes, so I have initially =
defined my=20
FD area<BR>&gt; thus...* Identify the external files to be used<BR>&gt; =
<BR>&gt;=20
&nbsp;SELECT F1-INFILEA ASSIGN TO "INFILEA".<BR>&gt; &nbsp;SELECT =
F2-INFILEB=20
ASSIGN TO "INFILEB".<BR>&gt; &nbsp;SELECT F3-OUTFILE ASSIGN TO=20
"OUTFILE".<BR>&gt; <BR>&gt; &nbsp;DATA DIVISION.<BR>&gt; &nbsp;FILE=20
SECTION.<BR>&gt; <BR>&gt; * Define the layout of the INFILEA input =
file<BR>&gt;=20
<BR>&gt; * INFILEA<BR>&gt; &nbsp;FD&nbsp; F1-INFILEA.<BR>&gt; =
&nbsp;01&nbsp;=20
F1-RECORD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
PIC X(1200).<BR>&gt; <BR>&gt; * Define the layout of the INFILEB input=20
file<BR>&gt; <BR>&gt; * INFILEB<BR>&gt; &nbsp;FD&nbsp; =
F2-INFILEB.<BR>&gt;=20
&nbsp;01&nbsp;=20
F2-RECORD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
PIC X(1200).<BR>&gt; <BR>&gt; <BR>&gt; ...however, when I read in a =
datafile,=20
say, that is<BR>&gt; 702bytes wide, my program gives a file error=20
tombstone<BR>&gt; complaining about the difference of 702 to my =
defined<BR>&gt;=20
1200.<BR>&gt; <BR>&gt; Can this situation be resolved with something as=20
simple<BR>&gt; as a file equation? I've tried a few, but without<BR>&gt; =

success.<BR>&gt; <BR>&gt; All help gratefully received.<BR>&gt; <BR>&gt; =

David.<BR>&gt; <BR>&gt; * To join/leave the list, search archives, =
change list=20
settings, *<BR>&gt; * 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>&gt; </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 *

ATOM RSS1 RSS2