Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on output format?

Status
Not open for further replies.

DarkParadox

Technical User
Nov 11, 2002
6
0
0
US
On my prog I have the output of a name and letter and other stuff. But when I look at my output it all looks like this
ex.

Mr. Joe Cool 1311 Bulm St. New York, NY Dear. Mr. Co

and I want it to look like this... ex

Mr. Joe Cool
1311 Bulm St.
New York, NY
Dear. Mr. Cool

My variables are set up at so...

01 output-rec.
05 Line1-out pic x(30).
05 Line2-out pic x(30).
and soforth.
Any help will be much greatfull. Thanks I now it my be easy but I'm just a beginner. Thanks.

 
Hi DarkParadox,

By default each line you write will print everything that's in 'output-rec'.

If you want to print:
Mr. Joe Cool
1311 Bulm St.
...

then,
MOVE "Mr. Joe Cool" TO output-rec
WRITE output-rec
MOVE "1311 Bulm St." TO output-rec
WRITE output-rec
MOVE "..." TO output-rec
WRITE output-rec

I know, its a handful. And all you need to accomplish this is:
01 output-rec PIC X(132).

Dimandja
 
Hi DarkParadox ,
This is quite simple ...whenever U have print on the next line we got write another "WRITE" statement .Hence u have to move the contents of the first line to the out-record ..in ur case its ..
Mr. Joe Cool
and use the write statement.
next move the second line
1311 Bulm St
and write it .....
simple as that...

change ur output record to

01 output-rec PIC X(132).

 
Only one line at a time is written.

Putting 2 records in the same record under an FD will not do it.

Try this.

01 I-SYSUT1-RECORD PIC X(080).

WORKING-STORAGE SECTION.
01 PRINT-LINES.
05 P-LINE01 PIC X (30) VALUE 'NAME OF PERSON'.
05 P-LINE02 PIC X (30) VALUE 'ADDR OF PERSON'.
05 P-LINE03 PIC X (30) VALUE 'PHON OF PERSON'.

MOVE P-LINE01 TO I-SYSUT1-RECORD.
WRITE I-SYSUT1-RECORD.

MOVE P-LINE02 TO I-SYSUT1-RECORD.
WRITE I-SYSUT1-RECORD.

MOVE P-LINE03 TO I-SYSUT1-RECORD.
WRITE I-SYSUT1-RECORD.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top