Page 1 of 1

change NULL characters to spaces

PostPosted: Mon Aug 02, 2010 3:35 pm
by erameshkumarkgm
Hi ,

I have data which have NULL characters ANY WHERE in the file and i need to change it into spaces using JCL sort or ICEMAN or ICETOOL .

Input: 417585555 COB2010WAP &@ WAP Ë -ekð15D CONTRACT MISSING IN THE DB

I have tried with the below code and it is not working.
//STEP10 EXEC PGM=ICEMAN                                       
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD DSN=A.INPUT.FILE,DISP=SHR   
//SORTOUT DD DSN=B.OUTPUT.FILE,                   
//           DISP=(,CATLG,DELETE),                             
//           UNIT=TESTDA,SPACE=(TRK,(10,10),RLSE)                 
//SYSIN    DD    *                                               
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,250)),                         
  IFTHEN=(WHEN=INIT,FINDREP=(IN=X'00',OUT=C' '))                 


Ramesh.

Re: change NULL characters to spaces

PostPosted: Mon Aug 02, 2010 5:55 pm
by erameshkumarkgm
I have checked the input in filemanager and below is the correct input.

input: N01575311..COB2010WAP..j.@.....01WAP..........01C....................................................................................................................................... OTC SEGMENT CALL FAILED


so i have to change the special characters like *, #,%,., to spaces.This will be any where in the record .

Re: change NULL characters to spaces

PostPosted: Mon Aug 02, 2010 6:25 pm
by erameshkumarkgm
i have used the below code and its changing the special characters @,-,& but the period '.' is not changing.

//STEPU040 EXEC PGM=ICEMAN
//**********************************************************************
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=WSIT.NONX.WSIP014D.ERROR.G0116V00.BKUP,DISP=SHR
//SORTOUT DD DSN=WSIT.NONX.MEDCOB.PARTD.TEST1,
// DISP=(OLD,CATLG,DELETE),
// DCB=(RECFM=F,LRECL=250,BLKSIZE=250),
// UNIT=TESTDA,SPACE=(TRK,(10,10),RLSE)
//SYSIN DD *
OPTION COPY
* SET UP ALTSEQ TABLE FOR TRAN=ALTSEQ.
* X'4B' = '.'. X'40' = BLANK. X'50' = '&'. X'7C' = '@'. X'60' = '-'.
ALTSEQ CODE=(5040,7C40,6040,4B40)
* USE TRAN=ALTSEQ TO CHANGE '$' (X'5B') TO ' ' (X'40').
OUTREC FIELDS=(1,250,TRAN=ALTSEQ)
/*


output: N01575311..COB2010WAP..j. .....01WAP..........01C........................................................................................................................................ OTC SEGMENT CALL FAILED

in this '@' is changed to spaces but period '.' is not changed.

ramesh.

Re: change NULL characters to spaces

PostPosted: Mon Aug 02, 2010 6:31 pm
by NicC
Probably your problem is that the periods are not actual periods but represent various unprintable characters. If you view the line in hex mode you will see what the actual codes are.

Re: change NULL characters to spaces

PostPosted: Mon Aug 02, 2010 9:45 pm
by skolusu
erameshkumarkgm wrote:Hi ,

I have data which have NULL characters ANY WHERE in the file and i need to change it into spaces using JCL sort or ICEMAN or ICETOOL .


erameshkumarkgm,

NULL characters do NOT any meaning. If your intention is to modify the unload of a DB2 table, then you need to understand what a NULL means. Look at the SYSPUNCH output and see how the null values are coded. If you replace x'00' , you are essentially ruining all the numeric fields. So first try to understand what a null is and then modify the contents

Re: change NULL characters to spaces

PostPosted: Mon Aug 09, 2010 11:36 am
by erameshkumarkgm
These special charecters are because of comp3 variables ,
SORT FIELDS=COPY
OUTREC BUILD=(1,17,
18,2,PD,EDIT=(IIIT),
20,10,
30,5,PD,EDIT=(IIIIIIIT),
35,5,PD,EDIT=(IIIIIIIT),
40,5,
45,5,PD,EDIT=(IIIIIIIT),
50,5,PD,EDIT=(IIIIIIIT),
55,196)
so i have converted those comp3 to normal variables and changed all NULL to SPACES
SORT FIELDS=COPY
ALTSEQ CODE=(0040)
OUTREC FIELDS=(1,264,TRAN=ALTSEQ)

This worked fine.
Thanks every one for your guidence.