W dniu 24.01.2023 o 22:52, Sri h Kolusu pisze:
The following scenario: Input file VB. At offset 23 (RDW included) 2-byte
field Other relevant fields are 101,8 109,8 181,8 No sort needed.
Radoslaw,
Use the following control cards which will give you the desired results. I
optimized the job a bit to include records that have a minimum length of 188
which is the last position of the field you are interested.
//TOOLIN DD *
COPY FROM(INPUT) TO(TMP) USING(ABCD)
DISPLAY FROM(TMP) LIST(REPORT) -
HEADER('CODE ') ON(001,8,CH) -
HEADER('DESC1') ON(009,8,CH) -
HEADER('DESC2') ON(017,8,CH) -
HEADER('DESC3') ON(025,8,CH) -
BLANK
/*
//ABCDCNTL DD *
INCLUDE COND=(1,2,BI,GE,188)
OUTFIL VTOF,
BUILD=(023,2,CHANGE=(8,X'0000',C'ALTER ',
X'0001',C'READ ',
X'0002',C'UPDATE '),
NOMATCH=(C'ERROR '),
101,08,
109,08,
181,08)
/*
Thank you Sri.
Nice trick with record length (1,2,BI...) I have to remember about it.
I have another problem to solve:
Depending on the field 23,2 we have word ALTER/READ in the report.
However the field contain other values, let's say X'1101' which should
be translated to C'CHANGE'... but this record type implies slightly
different format. For X'1101' I should use
HEADER('DESC3') ON(175,8,CH) - note, 188->175
and
HEADER('DESC4') ON(189,8,CH) - that fiel can be empty for X'0000',
X'0001', X'0002'
In other words different column taken to the report, depending on value
in the field 23,2. Is it possible?
Currently I simply have two separate reports, which is a little bit
error-prone. Before the above solution there were 4 separate reports, so
there is some progress. :-)
--
Radoslaw Skorupka
Lodz, Poland
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN