change NULL characters to spaces



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

change NULL characters to spaces

Postby erameshkumarkgm » Mon Aug 02, 2010 3:35 pm

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.
erameshkumarkgm
 
Posts: 9
Joined: Thu Jul 29, 2010 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: change NULL characters to spaces

Postby erameshkumarkgm » Mon Aug 02, 2010 5:55 pm

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 .
erameshkumarkgm
 
Posts: 9
Joined: Thu Jul 29, 2010 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: change NULL characters to spaces

Postby erameshkumarkgm » Mon Aug 02, 2010 6:25 pm

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.
erameshkumarkgm
 
Posts: 9
Joined: Thu Jul 29, 2010 11:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: change NULL characters to spaces

Postby NicC » Mon Aug 02, 2010 6:31 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: change NULL characters to spaces

Postby skolusu » Mon Aug 02, 2010 9:45 pm

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
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: change NULL characters to spaces

Postby erameshkumarkgm » Mon Aug 09, 2010 11:36 am

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.
erameshkumarkgm
 
Posts: 9
Joined: Thu Jul 29, 2010 11:38 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post