I need to format a i/p file to a required format
here is the I/p file
I/p data:
1999¦910¦111114-9¦111114-9¦¦OH¦
1999¦910¦111115-9¦111115-9¦¦PA¦
1999¦S02¦000000000000600000¦000000000000600000¦¦NY¦
1999¦S02¦000000000000600000¦000000000000600000¦¦NJ¦
1999¦¦111116-9¦111116-9¦¦AZ¦
Req:
the o/p should be having
1st column not considered in the o/p value
2nd column 3 char
3rd column 6 char
4th column 1 char from right (Eg: 111111-2 o/p should be 2)
5th column 2 char if dat is not there blank space
6th column 2 char
Required o/p should be like this
9101111149 OH
9101111159 PA
S020000000 NY
S020000000 NJ
1111169 AZ
My parser JCL is like
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A.B.SRC,DISP=SHR
//SORTOUT DD DSN=A.B.TGT,
// UNIT=DISK,SPACE=(TRK,(1,2),RLSE),
// DCB=(LRECL=18,BLKSIZE=0,RECFM=FB),
// DISP=(NEW,CATLG,DELETE)
//SYSSORT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
//SYSIN DD *
SORT FIELDS=COPY
INREC PARSE=(%00=(ENDBEFR=X'6A',FIXLEN=04),
%01=(ENDBEFR=X'6A',FIXLEN=03),
%02=(ENDBEFR=X'6A',FIXLEN=06),
%03=(ENDBEFR=X'6A',FIXLEN=01),
%04=(ENDBEFR=X'6A',FIXLEN=02),
%05=(ENDBEFR=X'6A',FIXLEN=02)),
BUILD=(%01,%02,%03,%04,%05)
/*
//
1999¦910¦111115-9¦111115-9¦¦PA¦
1999¦S02¦000000000000600000¦000000000000600000¦¦NY¦
1999¦S02¦000000000000600000¦000000000000600000¦¦NJ¦
1999¦¦111116-9¦111116-9¦¦AZ¦
Req:
the o/p should be having
1st column not considered in the o/p value
2nd column 3 char
3rd column 6 char
4th column 1 char from right (Eg: 111111-2 o/p should be 2)
5th column 2 char if dat is not there blank space
6th column 2 char
Required o/p should be like this
9101111149 OH
9101111159 PA
S020000000 NY
S020000000 NJ
1111169 AZ
My parser JCL is like
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A.B.SRC,DISP=SHR
//SORTOUT DD DSN=A.B.TGT,
// UNIT=DISK,SPACE=(TRK,(1,2),RLSE),
// DCB=(LRECL=18,BLKSIZE=0,RECFM=FB),
// DISP=(NEW,CATLG,DELETE)
//SYSSORT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
//SYSIN DD *
SORT FIELDS=COPY
INREC PARSE=(%00=(ENDBEFR=X'6A',FIXLEN=04),
%01=(ENDBEFR=X'6A',FIXLEN=03),
%02=(ENDBEFR=X'6A',FIXLEN=06),
%03=(ENDBEFR=X'6A',FIXLEN=01),
%04=(ENDBEFR=X'6A',FIXLEN=02),
%05=(ENDBEFR=X'6A',FIXLEN=02)),
BUILD=(%01,%02,%03,%04,%05)
/*
//
I struck with getting the 4th column right most data, if Just specify 1 it takes from left 1 char.
Can any one suggest the way to do it
Thanks
JRS