Update inline

W dniu 24.01.2023 o 20:39, Radoslaw Skorupka 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.

ICETOOL TOOLIN:
COPY FROM(INPUT) TO(TMP) USING(ABCD)
DISPLAY FROM(TMP) LIST(REPORT) -
HEADER('desc1') ON(101,8,CH) -
HEADER('desc2') ON(109,8,CH) -
HEADER('desc3') ON(181,8,CH) -
BLANK

//ABCDCNTL DD *
 OPTION COPY,VLSHRT

Now the problem:
I want to add new column to the report.  The value depend on 23,2 field content:
field              text in report
X'0000'  -> C'ALTER   '
X'0001' -> C'READ    '
X'0002' -> C'UPDATE  '
any other -> C'ERROR   '

I tried with OUTREC FIELD=(... CHANGE=(...)) with no effect (excluding various error codes).
Or maybe I should not change ABCDCNTL, rather modify TOOLIN instead?

I tried the following ABCDCNTL statement:
RECORD TYPE=V,LENGTH=(,,,50)
OUTREC FIELDS=(1,22,23,1,CHANGE=(8,
X'0001',C'READ    ' ...
and the above caused ICE111A error.
However I changed it to the following:
RECORD TYPE=V,LENGTH=(,,,50)
OUTREC FIELDS=(1,22,24,1,CHANGE=(8,
X'01',C'READ    ' ...
and now it works. Note, the change X'0001' to X'01' and 1,22,23,1 to 1,22,24,1 It seems I should specify 1,22,23,2 for X'0001' - the last 2 is length of change field.


--
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

Reply via email to