Page 1 of 1

Converting BIT String Value

PostPosted: Wed May 14, 2014 4:21 pm
by ravisankarc
Hi,

I want to convert a BIT string value into a readable format using ICETOOL control card. My input is as below:


Offset Type Length Description
74(X'4A') Bitstring 2 Dataset Organization

Can somebody help me on writing a control card.

Regards
Ravi

Re: Converting BIT String Value

PostPosted: Wed May 14, 2014 4:27 pm
by BillyBoyo
Which specific ICETOOL operator are you using?

Re: Converting BIT String Value

PostPosted: Wed May 14, 2014 5:20 pm
by ravisankarc
Hi Billy,

I am using the below operator :

OUTFIL VTOF,BUILD=(29,05,2X,13,4,2X,29,44,2X,160:X)

In the above control card I want to include the bit string field to get the readable output.

"I don't know how to use 'code' while giving replies. Can somebody teach me so that it will be helpful for me to display the requirement in a professional way."

Regards
Ravi

Re: Converting BIT String Value

PostPosted: Wed May 14, 2014 6:19 pm
by enrico-sorichetti
the snippet
****** ***************************** Top of Data ******************************
- - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  3 Line(s) not Displayed
000004 //S1      EXEC PGM=SORT
000005 //SYSPRINT  DD SYSOUT=*
000006 //SYSOUT    DD SYSOUT=*
000007 //TOOLMSG   DD SYSOUT=*
000008 //DFSMSG    DD SYSOUT=*
000009 //SORTIN    DD *
000010 ABCDEFGHI
000011 JKLMNOPQR
000012 STUVWXYZ
000013 0123456789
000014 //SORTOUT   DD SYSOUT=*,DCB=(RECFM=FB,LRECL=80)
000015 //SYSIN     DD *
000016   OPTION COPY
000017   OUTREC FIELDS=(1,10,C' ==> ',1,10,HEX)
****** **************************** Bottom of Data ****************************


the result
********************************* TOP OF DATA **********************************
ABCDEFGHI  ==> C1C2C3C4C5C6C7C8C940
JKLMNOPQR  ==> D1D2D3D4D5D6D7D8D940
STUVWXYZ   ==> E2E3E4E5E6E7E8E94040
0123456789 ==> F0F1F2F3F4F5F6F7F8F9
******************************** BOTTOM OF DATA ********************************

Re: Converting BIT String Value

PostPosted: Wed May 14, 2014 6:38 pm
by BillyBoyo
enrico, bits, not hex.

More politely than usual, may I suggest that you should prefer BUILD over FIELDS on OUTREC and BUILD over OUTREC on OUTFIL. BUILD is not overloaded, FIELDS and OUTREC are. BUILD is a synonym of FIELDS on INREC, OUTREC and OUTREC on OUTFIL. DFSORT/SyncSort don't care, just a bit clearer for us :-)

Re: Converting BIT String Value

PostPosted: Wed May 14, 2014 6:59 pm
by enrico-sorichetti
enrico, bits, not hex.

I have seen that, but nowhere I know

c'1' ==> x'f1'

will be displayed as
 b'11110001'


:mrgreen:

c /FIELDS/BUILD/* *


I feel strongly that the people asking should take the replies as starting points to investigate further
and not lazily use what is posted without understanding it.

Re: Converting BIT String Value

PostPosted: Wed May 14, 2014 7:24 pm
by ravisankarc
Hi All,

I have given the bit string field in INCLUDE COND statement and got the desired output. Thank you for the above suggestions will keep the same for future reference.

Hence, closing this topic.

Regards
Ravi

Re: Converting BIT String Value

PostPosted: Wed May 14, 2014 7:36 pm
by enrico-sorichetti
I have given the bit string field in INCLUDE COND statement and got the desired output.


that' s not what You asked in the initial question :twisted:

Re: Converting BIT String Value

PostPosted: Wed May 14, 2014 7:57 pm
by BillyBoyo
Yes. Bitstring on INCLUDE for SORT. Not really very close to the original question.