Page 1 of 1

How to convert Hex to PD

PostPosted: Tue Mar 02, 2010 3:37 pm
by manjeera.bonakurthi
Hi

I have input file in which one field is in Hex .Now i need to convert this field alone to PD using JCL SORT .
How can I achieve this?

Re: How to convert Hex to PD

PostPosted: Tue Mar 02, 2010 11:27 pm
by Alissa Margulies
Since you did not provide any information regarding your actual data (position/length of HEX field, DCB attributes of file, etc.), I created this example:
//STEP1 EXEC PGM=SORT                                             
//SYSOUT  DD SYSOUT=*                                               
//SORTIN  DD *                                                       
000004A4
00001000                                                                                                     
//SORTOUT DD DSN=OUTPUT.FILE,...
//SYSIN   DD *                                                     
  ALTSEQ CODE=(F000,F101,F202,F303,F404,F505,F606,F707,F808,F909, 
               C10A,C20B,C30C,C40D,C50E,C60F)                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(41:1,8,TRAN=ALTSEQ)),           
        IFTHEN=(WHEN=INIT,                                         
        OVERLAY=(41:(48,1,BI,ADD,                                 
                    (47,1,BI,MUL,+16),ADD,                         
                    (46,1,BI,MUL,+256),ADD,                       
                    (45,1,BI,MUL,+4096),ADD,                       
                    (44,1,BI,MUL,+65536),ADD,                     
                    (43,1,BI,MUL,+1048576),ADD,                   
                    (42,1,BI,MUL,+16777216),ADD,                   
                    (41,1,BI,MUL,+268435456)))),                   
        IFTHEN=(WHEN=INIT,                                         
        BUILD=(41,15,ZD,PD))                                       
  SORT FIELDS=COPY                                                 
/*

Re: How to convert Hex to PD

PostPosted: Wed Mar 03, 2010 1:47 am
by dick scherrer
Hello,

I have input file in which one field is in Hex
Unfortunately, every field in every file is in Hex. . .

When asking for help, it is important to provide sufficient detail. . .

Re: How to convert Hex to PD

PostPosted: Wed Mar 03, 2010 4:34 pm
by manjeera.bonakurthi
Hi Alissa
Thank u for ur help...

Re: How to convert Hex to PD

PostPosted: Wed Mar 03, 2010 9:07 pm
by Alissa Margulies
Glad you found my example useful.

In the future, please keep in mind that it would be more helpful to those of us trying to assist you if you could post more specific details about your job requirments. Posting sample input records and the desired output, along with the file attributes is a good place to start.