I have used REPLACE syntax to replace comma with space and using batch job to retrieve data from the table but in the file i could see junk character replaced before the data and if i won't use the replace syntax then i am not getting that junk character. My requirement is to replace comma with space and shouldn't append any junk character. I am not able to figure out why these jonk characters are appending. Details are mentioned below, please help me.
Query used in SYSIN CARD;
SELECT REPLACE(SUBSTR(CL.CLNT_NM,1,40),',','') CLNT_NM,CHAR(',')
Job Card:
//FD4106CA EXEC PGM=IKJEFT01,DYNAMNBR=50
//STEPLIB DD DSN=DB2O.SDSNLOAD,DISP=SHR
//SYSTSIN DD DSN=CFS4.Y6700.SYSIN(FD4106CA),DISP=SHR
//SYSPUNCH DD DUMMY,DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,SPACE=(TRK,(5,5))
//SYSREC00 DD DSN=CEA1.BFD33H.SR02249.REPORT(+1),
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,SPACE=(TRK,(100,50),RLSE),
// DCB=(RECFM=FB,LRECL=360,BLKSIZE=0)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DSN=CEA1.BFD33H.SR02249.SYSIN(FD4EX1AC),DISP=SHR
//STEPLIB DD DSN=DB2O.SDSNLOAD,DISP=SHR
//SYSTSIN DD DSN=CFS4.Y6700.SYSIN(FD4106CA),DISP=SHR
//SYSPUNCH DD DUMMY,DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,SPACE=(TRK,(5,5))
//SYSREC00 DD DSN=CEA1.BFD33H.SR02249.REPORT(+1),
// DISP=(NEW,CATLG,DELETE),
// UNIT=DISK,SPACE=(TRK,(100,50),RLSE),
// DCB=(RECFM=FB,LRECL=360,BLKSIZE=0)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DSN=CEA1.BFD33H.SR02249.SYSIN(FD4EX1AC),DISP=SHR
Out put File: (In the below file, you can see hex value data 0028 is the junk data when i run the query with REPLACE syntax)
CEA1.BFD33H.SR02249.REPORT.G0023V00
===>
----+----1----+----2----+----3----+----
***************************** Top of Da
Ahold USA Wrap Up
02C89984EEC4E9894E944444444444444444444
081863404210691704700000000000000000000
---------------------------------------
Ahold USA Wrap Up
02C89984EEC4E9894E944444444444444444444
081863404210691704700000000000000000000
---------------------------------------
Amerisource Bergen Corporation
02C9898A9A9884C898894C999998A8994444444
081459926493502597550369769139650000000
===>
----+----1----+----2----+----3----+----
***************************** Top of Da
Ahold USA Wrap Up
02C89984EEC4E9894E944444444444444444444
081863404210691704700000000000000000000
---------------------------------------
Ahold USA Wrap Up
02C89984EEC4E9894E944444444444444444444
081863404210691704700000000000000000000
---------------------------------------
Amerisource Bergen Corporation
02C9898A9A9884C898894C999998A8994444444
081459926493502597550369769139650000000