i have a test souce as
PLIPGM: PROC OPTIONS(MAIN);
DCL 01 A,
02 A1 CHAR(02) INIT('T~'),
02 A2 CHAR(10) VAR INIT('ABC'),
02 A3 CHAR(02) INIT('~T');
DCL INFILE FILE RECORD INPUT;
DCL REPORT FILE RECORD OUTPUT,
SYSPRINT FILE STREAM OUTPUT;
OPEN FILE (INFILE) INPUT;
OPEN FILE (REPORT) OUTPUT,
FILE (SYSPRINT) OUTPUT;
PUT SKIP(2) EDIT ('ABC:',A,':')(A,A,A);
WRITE FILE (REPORT) FROM (A);
CLOSE FILE (INFILE),
FILE (REPORT),
FILE (SYSPRINT);
END PLIPGM;
DCL 01 A,
02 A1 CHAR(02) INIT('T~'),
02 A2 CHAR(10) VAR INIT('ABC'),
02 A3 CHAR(02) INIT('~T');
DCL INFILE FILE RECORD INPUT;
DCL REPORT FILE RECORD OUTPUT,
SYSPRINT FILE STREAM OUTPUT;
OPEN FILE (INFILE) INPUT;
OPEN FILE (REPORT) OUTPUT,
FILE (SYSPRINT) OUTPUT;
PUT SKIP(2) EDIT ('ABC:',A,':')(A,A,A);
WRITE FILE (REPORT) FROM (A);
CLOSE FILE (INFILE),
FILE (REPORT),
FILE (SYSPRINT);
END PLIPGM;
when i checked output file, the writen record is
T~..ABC.......~T
when i cheked sysprint, displaied as
ABC:T~ABC~T:
The value of A2 is different between in write file and sysprint, why? if i want to write the record as
ABC:T~ABC~T: