Parsing and converting to binary



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Parsing and converting to binary

Postby dja2 » Thu Jul 12, 2012 1:29 pm

firstly, this is my first attempt at a question in this forum, so if I miss things out of my explanation, please be patient...

I am attempting to convert an input file delimited by "¦', and converting those numeric input fields to four-byte binary fields.
Using the included JCL, (with no attempt at conversion), the resulting parsed fields a left-justified characters. Is it possible to parse these fields so the resulting fields are four-byte binary?

So, during the "BUILD" phase, is it possible, to convert, (for instance), "CONID" directly to a four-byte binary field ?

The fields in question are those that end in "...ID".
 UNIT,%00     
TEAM,%01     
RM,%02       
CONID,%03   
INTCSTID,%04
CONNAME,%05 
CUSTNAME,%06
CIN,%07     
CIS,%08     
APPID,%09   
FACID,%10   
SC,%11       
AN,%12       
BSORT,%13   
BAN,%14
//SYSIN    DD *                                   
  SORT FIELDS=COPY                               
  INREC PARSE=(UNIT=(ENDBEFR=C'¦',FIXLEN=60),     
               TEAM=(ENDBEFR=C'¦',FIXLEN=60),     
               RM=(ENDBEFR=C'¦',FIXLEN=90),       
               CONID=(ENDBEFR=C'¦',FIXLEN=15),   
               INTCSTID=(ENDBEFR=C'¦',FIXLEN=15),
               CONNAME=(ENDBEFR=C'¦',FIXLEN=80), 
               CUSTNAME=(ENDBEFR=C'¦',FIXLEN=120),
               CIN=(ENDBEFR=C'¦',FIXLEN=20),     
               CIS=(ENDBEFR=C'¦',FIXLEN=20),     
               APPID=(ENDBEFR=C'¦',FIXLEN=15),   
               FACID=(ENDBEFR=C'¦',FIXLEN=15),   
               SC=(ENDBEFR=C'¦',FIXLEN=6),       
               AN=(ENDBEFR=C'¦',FIXLEN=8),       
               BSORT=(ENDBEFR=C'¦',FIXLEN=15),   
               BAN=(ENDBEFR=C'¦',FIXLEN=8)),     
         BUILD=(SC,AN,                 
       C' KEY ',UNIT,TEAM,RM,
       C' CONID ',CONID,     
       C' INTCSTID ',INTCSTID,
       C' CIN ',CIN,         
       C' CIS ',CIS,         
       C' APPID ',APPID,     
       C' FACID ',FACID)     


and the input file, (upto the sixth field) looks like...

UNIT1 TEST¦TEAM1¦RM1¦1234567890¦1234567899¦CONNECTION NAME¦CU
UNIT2 TEST¦TEAM1¦RM1¦1234567890¦1234567899¦CONNECTION NAME¦CU
UNIT2 TEST¦TEAM1¦RM1¦1234567890¦1234567899¦CONNECTION NAME¦CU
UNIT2 TEST¦TEAM1¦RM1¦1234567890¦1234567899¦CONNECTION NAME¦CU
UNIT2 TEST¦TEAM1¦RM1¦1234567890¦1234567899¦CONNECTION NAME¦CU
dja2
 
Posts: 20
Joined: Wed Jul 11, 2012 6:11 pm
Has thanked: 13 times
Been thanked: 0 time

Re: Parsing and converting to binary

Postby skolusu » Thu Jul 12, 2012 10:09 pm

dja2,

It is quite simple to convert the numeric fields to Binary.

Assuming you have only positive numbers then change the CONID field to the following

C' CONID ',CONID,UFF,BI,LENGTH=4,


If you have both positive and negative numbers then you need to use SFF format for input and FI format for output like shown below
C' CONID ',CONID,SFF,FI,LENGTH=4,
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

These users thanked the author skolusu for the post:
dja2 (Fri Jul 13, 2012 2:15 pm)
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Parsing and converting to binary

Postby dja2 » Fri Jul 13, 2012 2:16 pm

Kosulu, Thanks again for the reply. This not only solved my problem, but also helped to answer a lot of other questions lurking in my brain.
dja2
 
Posts: 20
Joined: Wed Jul 11, 2012 6:11 pm
Has thanked: 13 times
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post