Joined: 19 Sep 2019 Posts: 3 Location: United Kingdom
We're currently using ICETOOL/DFSORT to format a bunch of fields in a data dump. One of the fullwords that we currently decode using:
57:63,4,HEX,
is, in reality, actually a collection of bits that I'd rather decode bit-by-bit into some meaningful character to represent its function if set, or a dot (or lower case character, maybe) if not set.
Is such a decoding easily possible in dfsort, or should I be looking at doing this in Rexx?
Any pointers to where in the rather extensive documentation I might start with this would be much appreciated.
This looks promising, but seems to deal only options on the INCLUDE statement, whereas it looks like I need something that works on the BUILD statement, no? Or have I missed something?
a collection of bits that I'd rather decode bit-by-bit into some meaningful character to represent its function if set, or a dot (or lower case character, maybe) if not set.
Sorry for misunderstanding the question. Maybe this is closer to what you want:
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
Use possibilities provided
Code:
//WHATEVER EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
LINE 99 Ninetynine
LINE 05 FIVE
LINE 03 THREE
LINE 01 ONE
LINE 02 TWO
LINE 04 FOUR
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1,5,6:6,2,ZD,TO=BI,LENGTH=2))
SORT FIELDS=(COPY)
OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,5,X,6,2,TRAN=BIT)),
IFTHEN=(WHEN=INIT,
FINDREP=(INOUT=(C'0',C'.',C'1',C'Y'),STARTPOS=7,DO=16))
END
/*
gives
Code:
LINE .........YY...YY
LINE .............Y.Y
LINE ..............YY
LINE ...............Y
LINE ..............Y.
LINE .............Y..
Joined: 19 Sep 2019 Posts: 3 Location: United Kingdom
Marso wrote:
...
Hi Marso --
That was /exactly/ what I was after, many thanks for that. A whole lot of CHANGE cards were indeed required, but that was fine: I wanted to choose the symbol for each bit independently.
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
@Marso: That is correct. As your sample had the 1:1 translation functionality implemented, I used that to simplify. If one wants a more readable form your suggestion would be the right way to go.