The following example illustrates some of the considerations that apply to the STRING statement.
01 RPT-LINE PICTURE X(120).
01 LINE-POS PICTURE 99.
01 LINE-NO PICTURE 9(5) VALUE 1.
01 DEC-POINT PICTURE X VALUE ".".
01 RCD-01.
05 CUST-INFO.
10 CUST-NAME PICTURE X(15).
10 CUST-ADDR PICTURE X(34).
05 BILL-INFO.
10 INV-NO PICTURE X(6).
10 INV-AMT PICTURE $$,$$$.99.
10 AMT-PAID PICTURE $$,$$$.99.
10 DATE-PAID PICTURE X(8).
10 BAL-DUE PICTURE $$,$$$.99.
10 DATE-DUE PICTURE X(8).
The programmer wants to construct an output line consisting of portions of the information from RCD-01. The line is to consist of a line number, customer name and address, invoice number, date due, and balance due, truncated to the dollar figure shown.
J.B.␢SMITH␢␢␢␢␢
444␢SPRING␢ST.,␢CHICAGO,␢ILL.␢␢␢␢␢
A14275
$4,736.85
$2,400.00
09/22/76
$2,336.85
09/09/94
STRING LINE-NO SPACE
CUST-INFO SPACE
INV-NO SPACE
DATE-DUE SPACE
DELIMITED BY SIZE,
BAL-DUE
DELIMITED BY DEC-POINT
INTO RPT-LINE
WITH POINTER LINE-POS.
