I need help with below Sort:
Input data will be of this format:
"1234"||"567"||"gtyhjgdgh"||" " ||" " ||"y"||
"4"||"5"||"hj8bjh"||" "||" " ||"y"||
"4"||"6"||"hj8bjh"||" "||" " ||"y"||
"1"||"7"||"98bjh"||" "||" " ||"y"||
"9"||"6"||"gtyhh"||" " ||"Y " ||"y"||
"4"||"4"||"hj8bjh"||" "||" " ||"y"||
"4"||"5"||"hj8bjh"||" "||" " ||"y"||
"4"||"6"||"hj8bjh"||" "||" " ||"y"||
"1"||"7"||"98bjh"||" "||" " ||"y"||
"9"||"6"||"gtyhh"||" " ||"Y " ||"y"||
"4"||"4"||"hj8bjh"||" "||" " ||"y"||
and o/p should be
1234
4
1
9
4
1
9
i.e. it should eliminate the " and || and should also stop copying when it hits | in the first line and move to next line.
With FINDREP option I am able to remove " and || but how to stop copying once it has encountered | and move copy to next line.
//STEP0001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=FILE1,DISP=SHR
//SORTOUT DD DSN=FILE2,DISP=SHR
//SYSIN DD *
OPTION COPY
INREC FINDREP=(INOUT=(C'"',C'',C'|',C''))
is giving me
1234567GTYHJGDGH Y
45HJ8BJH Y
46HJ8BJH Y
1798BJH Y
96GTYHH Y Y
44HJ8BJH Y
45HJ8BJH Y
46HJ8BJH Y
1798BJH Y
96GTYHH Y Y
44HJ8BJH Y
which is working as FINDREP is coded.
Regards..