needhelp wrote:When I run this, the blank lines show up, do I need to code this another way? If there is nothing in address-line2, 3 or 4 I don't want those lines to print, if there is something there, I want them to print.
JOB INPUT INFILE
IF EOF INFILE
STOP
END-IF
PRINT REPORT1
REPORT REPORT1 PAGESIZE 55 SKIP 1 PRINTER (REPORT1) LINESIZE 132
HEADING ( 'ADDRESS')
LINE 1 ADDRESS-LINE1
LINE 2 ADDRESS-LINE2
LINE 3 ADDRESS-LINE3
LINE 4 ADDRESS-LINE4
LINE 5 ADDRESS-CITY ADDRESS-STATE
LINE 6 ZIP10
A table, as Dick has said, will clear your initial problem.
The next problem might be, well, that method leaves a load of blank lines in between addresses.
If you don't want that:
JOB INPUT INFILE +
NAME PRODUCE-ADDRESS-REPORT-FROM-ALL-INPUT
PRINT REPORT1
REPORT REPORT1 +
PAGESIZE 55 +
SKIP 1 +
PRINTER REPORT1 +
LINESIZE 132
HEADING 'ADDRESS'
LINE 1 ADDRESS-LINE1
AFTER-LINE. PROC
IF ADDRESS-LINE2 NE " "
DISPLAY +
POS 1 +
ADDRESS-LINE2
END-IF
IF ADDRESS-LINE3 NE " "
DISPLAY +
POS 1 +
ADDRESS-LINE3
END-IF
IF ADDRESS-LINE4 NE " "
DISPLAY +
POS 1 +
ADDRESS-LINE4
END-IF
IF ADDRESS-CITY NE " "
DISPLAY +
POS 1 +
ADDRESS-CITY
ADDRESS-STATE
ELSE
IF ADDRESS-STATE NE " "
DISPLAY +
POS 1 +
ADDRESS-STATE
END-IF
END-IF
END-PROC
I removed your IF EOF, because that is handled automatically by the JOB statement, so yours would never be executed (it is necessary with JOB INPUT NULL and your own GETs).
I have also made it look a bit more pretty.
The problem this gives you is the end-of-page processing. Lucky for you, Easytrieve now supports access to the LINE-COUNT (number of lines printed).
There is more than one way to go about dealing with this, so it is time for you to have a go if you fancy it. Note, you might feel the need to replace my if's with Dick's solution in the after-line. proc. Feel free.