Page 1 of 1

SFF to binary

PostPosted: Wed Oct 03, 2012 8:46 pm
by dja2
I am trying to convert a delimited input file to a fixed-length field output record.

My JCL is;

//STEP030  EXEC PGM=SORT,COND=(0,NE)                     
//SORTIN   DD DSN=RMSDATA.PGUO.NSTXNS.PGQI.RMPMIBUS.TEMP,DISP=SHR                 
//SORTOUT  DD DSN=RMSDATA.PGUO.NSTXNS.PGQI.RMPMIBUS.S0000,
//            DISP=(NEW,CATLG,DELETE),                   
//            DCB=(LRECL=432,RECFM=FB),                   
//            DSORG=PS,                                   
//            SPACE=(CYL,(100,50),RLSE)                   
//SORTMSG  DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYMNAMES DD *                                           
UNIT,%00                                                 
TEAM,%01                                                 
RM,%02                                                   
CONNAME,%03                                               
APPURP,%04                                               
APPID,%05                                                 
BUSNTS,%06                                               
AGECOM,%07                                               
NUMDIR,%08                                       
//SYSIN    DD *                                   
  SORT FIELDS=COPY                               
  INREC PARSE=(UNIT=(ENDBEFR=C'|',FIXLEN=60),     
               TEAM=(ENDBEFR=C'|',FIXLEN=60),     
               RM=(ENDBEFR=C'|',FIXLEN=90),       
               CONNAME=(ENDBEFR=C'|',FIXLEN=80), 
               APPURP=(ENDBEFR=C'|',FIXLEN=120), 
               APPID=(ENDBEFR=C'|',FIXLEN=4),     
               BUSNTS=(ENDBEFR=C'|',FIXLEN=10),   
               AGECOM=(ENDBEFR=C'|',FIXLEN=4),   
               NUMDIR=(ENDBEFR=C'|',FIXLEN=4)),   
        BUILD=(UNIT,TEAM,RM,CONNAME,APPURP,       
               APPID,UFF,BI,LENGTH=4,             
               BUSNTS,                           
               AGECOM,UFF,BI,LENGTH=4,           
               NUMDIR,SFF,TO=BI,LENGTH=4) 

The relevant portion of a sample input record is;
000007    ID|ADAMS MR P S T/A ADAMS & CO|Increase|931072110|26/04/2012|-9|-9           


The relevant portion of an output record is;
000007                                                            ;26/04/2012       
          444444444444444444444444444444444444444444444444440025FF6FF6FFFF00000000
          00000000000000000000000000000000000000000000000000004E261041201200090009

I can understand why the first x'00000009' is not signed, (I haved used UFF, not SFF), but I can't understand why the second x'00000009' is not whatever is binary for -9, or have I misunderstood the meaning of "SFF"?

Re: SFF to binary

PostPosted: Wed Oct 03, 2012 8:58 pm
by BillyBoyo
Have a look at Appendix C of the DFSort Application Programming Guide. You'll find that BI is unsigned. FI is probably what you are looking for.

Nice to see the use of Symbols, by the way :-)

Re: SFF to binary

PostPosted: Wed Oct 03, 2012 9:18 pm
by skolusu
dja2,

As bill mentioned BI is binary unsigned. If you need to retain the sign, then you need FI format. Check this link explains in detail about the various DFSORT formats.

http://publibz.boulder.ibm.com/cgi-bin/ ... e1ca60/C.1?

Re: SFF to binary

PostPosted: Thu Oct 04, 2012 12:31 pm
by dja2
Thanks to both of you, especially for the links to the documentation