i tried following code but it captures before and after bytes as well. Now, I also want to add check if the first record contains '001 then take the date only e.g. 2009-02-04 and copy it to a GDG file without any before and after spaces.
i have tried following as well, which get rid of before bytes, but still contain after bytes.
Header sample:001 2009-02-05 10:55:06 MLK00 2009-02-04 SOURCE.DATASET.NAME(0)
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=SOURCE.DS,DISP=SHR
//OUT DD DSN=TARGET.DS,
//TOOLIN DD *
COPY FROM(IN) TO(OUT) USING(CTL1)
//CTL1CNTL DD *