In Cobol, large amount of spaces between records due to variable definition
- From: "GeneralBullmoose" <psmithphil@xxxxxxxxx>
- Date: 24 May 2005 12:12:00 -0700
I am building a variable that gets notes from an input file. The
variable may end up containing notes that may be 1 character or made up
of up to 1900 characters. I use this one variable for writing to an
output file. In Cobol, I'm assuming I have to define this variable
in the Working-Storage:
01 THE-NOTE-STRING-COMPLETE PIC X(1900).
I'm assuming I have to make it this variable 1900 characters since
the notes can get that big. They are then written to the output file:
FD PNOTES-NEW-OUT
LABEL RECORDS ARE STANDARD.
01 PNOTES-NEW-OUT-RECORD.
05 WK3-PNOTES-COMPLETE-LINE PIC X(1900).
When it writes to the output file, due to the variable being defined at
1900 characters, there may be a large amount of spaces between records
because the previous record has only a small amount of notes. In the
example below, the "~PRICE VALID TILL STOCK OUT" is the only notes
for that record, so there are almost 1900 spaces between the end of
that record and the next:
===========EXAMPLE========================
~PRICE VALID TILL STOCK OUT
Up to almost 1900 spaces between the 2 records!!
HAZARDOUS(1) MTRL, PACK PER CFR~TOLUENE(1); FLASH POINT 6 TO END OF
LINE~SHIP(1)
==========END OF EXAMPLE===================
I want all the trailing spaces in each record eliminated. I don't
know how this can be done since the variable is defined at 1900
characters. And I didn't think Cobol allowed you to have a
"variable-sized" variable. I feel like I'm going about this in
the wrong manner and don't know how to remedy this issue. Can you
help? Thank you!
.
- Follow-Ups:
- Prev by Date: Re: Passing an invalid date to INTEGER-OF-DATE
- Next by Date: Re: IBM S/390 memory model amd COBOL
- Previous by thread: Passing an invalid date to INTEGER-OF-DATE
- Next by thread: Re: In Cobol, large amount of spaces between records due to variable definition
- Index(es):
Relevant Pages
|
|