The main difference between then and now is that I do not have time in the field -- just a date -- and it's not a requirement that it will be populated. How can I handle an empty field in a date field?
This is what I tried:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
"D1","","","MOREDATA12345"
"DATA2","12/1/2010","","MOREDATA2"
"DATA3","","8/5/2011","MOREDATA3"
"DATA4","9/2/2008","11/15/2011","MOREDATA4"
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC PARSE=(%01=(ABSPOS=2,ENDBEFR=C'","',FIXLEN=10),
*
%02=(ENDBEFR=C'/',FIXLEN=2),
%03=(ENDBEFR=C'/',FIXLEN=2),
%04=(ENDBEFR=C'","',FIXLEN=4),
*
%05=(ENDBEFR=C'/',FIXLEN=2),
%06=(ENDBEFR=C'/',FIXLEN=2),
%07=(ENDBEFR=C'","',FIXLEN=4),
%07=(ENDBEFR=C'","',FIXLEN=4),
*
%08=(ENDBEFR=C'"',FIXLEN=10)),
BUILD=(%01,
%04,UFF,EDIT=(TTTT),
C'/',
%02,UFF,EDIT=(TT),
C'/',
%03,UFF,EDIT=(TT),
%07,UFF,EDIT=(TTTT),
C'/',
%05,UFF,EDIT=(TT),
C'/',
%06,UFF,EDIT=(TT),
%08)
/*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
"D1","","","MOREDATA12345"
"DATA2","12/1/2010","","MOREDATA2"
"DATA3","","8/5/2011","MOREDATA3"
"DATA4","9/2/2008","11/15/2011","MOREDATA4"
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC PARSE=(%01=(ABSPOS=2,ENDBEFR=C'","',FIXLEN=10),
*
%02=(ENDBEFR=C'/',FIXLEN=2),
%03=(ENDBEFR=C'/',FIXLEN=2),
%04=(ENDBEFR=C'","',FIXLEN=4),
*
%05=(ENDBEFR=C'/',FIXLEN=2),
%06=(ENDBEFR=C'/',FIXLEN=2),
%07=(ENDBEFR=C'","',FIXLEN=4),
%07=(ENDBEFR=C'","',FIXLEN=4),
*
%08=(ENDBEFR=C'"',FIXLEN=10)),
BUILD=(%01,
%04,UFF,EDIT=(TTTT),
C'/',
%02,UFF,EDIT=(TT),
C'/',
%03,UFF,EDIT=(TT),
%07,UFF,EDIT=(TTTT),
C'/',
%05,UFF,EDIT=(TT),
C'/',
%06,UFF,EDIT=(TT),
%08)
/*
This is the output from the above
********************************* TOP OF DATA **********************************
D1 0000/00/000000/00/00
DATA2 2010/12/010000/00/00
DATA3 2011/00/050000/00/00
DATA4 2008/09/022011/11/15MOREDATA4
******************************** BOTTOM OF DATA ********************************
D1 0000/00/000000/00/00
DATA2 2010/12/010000/00/00
DATA3 2011/00/050000/00/00
DATA4 2008/09/022011/11/15MOREDATA4
******************************** BOTTOM OF DATA ********************************
This is what I was hoping for:
********************************* TOP OF DATA **********************************
D1 0000/00/000000/00/00MOREDATA12345
DATA2 2010/12/010000/00/00MOREDATA2
DATA3 0000/00/002011/08/05MOREDATA3
DATA4 2008/09/022011/11/15MOREDATA4
******************************** BOTTOM OF DATA ********************************
D1 0000/00/000000/00/00MOREDATA12345
DATA2 2010/12/010000/00/00MOREDATA2
DATA3 0000/00/002011/08/05MOREDATA3
DATA4 2008/09/022011/11/15MOREDATA4
******************************** BOTTOM OF DATA ********************************