Auryn
New User
Joined: 11 Jan 2006 Posts: 83 Location: Lower Saxony (DE)
|
|
|
|
Hi there again,
this time I am quite a bit desperate trying to transform data with the ICETOOL:
I’ve got an old dataset whose content at some positions is very ‘crazy’. The good thing is the datasets recfm is fix (100 bytes) and its columns are pretty good to handle with COBOL or ICETOOL.
But the data type of some columns depend on other columns i.e. in some cases the content of one column is binary, in some cases packed decimal, in some other cases... Or a pd-coded date column does not contain the century and I’d like to transform it in a ZD date with leading century depending on the date (i.e. date gt “181231 => century := ‘19’, otherwise century := ‘20’, here »13,04,PD,GT,181231«).
I’m trying to transform that input dataset but I’m not successful using the OUTREC IFTHEN clauses.
I was successful when I coded one IFTHEN clause for each combination of all variants of column A and all variants of column B and all variants of …
Code: |
OUTREC IFTHEN=(WHEN=(17,02,CH,NE,X'0033',AND,
13,04,PD,GT,181231),
BUILD=(C'HFKEYS', /* col ALPHA
17,02,BI,TO=ZD,LENGTH=5, /* col BRAVO 1
19,10, /* col BRAVO 2a
C' ', /* col BRAVO 3a
C' ', /* col CHARLIE
C'19', /* col DELTA 1a
13,04,PD,TO=ZD,LENGTH=6, /* col DELTA 2
C'INITIAL ', /* col ECHO
C'|', /* separating constant
01,100)), /* complete input record
IFTHEN=(WHEN=(17,02,CH,NE,X'0033',AND,
13,04,PD,LE,181231),
BUILD=(C'HFKEYS', /* col ALPHA
17,02,BI,TO=ZD,LENGTH=5, /* col BRAVO 1
19,10, /* col BRAVO 2a
C' ', /* col BRAVO 3a
C' ', /* col CHARLIE
C'20', /* col DELTA 1a
13,04,PD,TO=ZD,LENGTH=6, /* col DELTA 2
C'INITIAL ', /* col ECHO
C'|', /* separating constant
01,100)), /* complete input record
IFTHEN=(WHEN=(17,02,CH,EQ,X'0033',AND, /* col ALPHA
13,04,PD,GT,181231),
BUILD=(C'HFKEYS', /* col ALPHA
17,02,BI,TO=ZD,LENGTH=5, /* col BRAVO 1
19,03,PD,TO=ZD,LENGTH=5, /* col BRAVO 2b
22,07, /* col BRAVO 3b
C' ', /* col CHARLIE
C'19', /* col DELTA 1a
13,04,PD,TO=ZD,LENGTH=6, /* col DELTA 2
C'INITIAL ', /* col ECHO
C'|', /* separating constant
01,100)), /* complete input record
IFTHEN=(WHEN=(17,02,CH,EQ,X'0033',AND,
13,04,PD,LE,181231),
BUILD=(C'HFKEYS', /* col ALPHA
17,02,BI,TO=ZD,LENGTH=5, /* col BRAVO 1
19,03,PD,TO=ZD,LENGTH=5, /* col BRAVO 2b
22,07, /* col BRAVO 3b
C' ', /* col CHARLIE
C'20', /* col DELTA 1b
13,04,PD,TO=ZD,LENGTH=6, /* col DELTA 2
C'INITIAL ', /* col ECHO
C'|', /* separating constant
01,100)) /* col ALPHA |
This sample is not complete and doesn’t represent all variants. But it already looks very confusing
I’m looking for a solution where I prepare each constant or variable part of the record one by one.
I’m experimenting with WHEN=INIT, WHEN=ANY and WHEN=NONE clauses, I’m experimenting with HIT=NEXT clauses, I’m experimenting with a clause WHEN=(01,08,EQ,C’CONSTVAL’) which is a constant value in the input dataset at this position for all variants of records, …
How can I combine several constant and variable kinds of transformation and concatenate the results of each single column transformation to a new outrec?
Thank you all for your hints
Auryn |
|