OPTION COPY
OUTFIL REMOVECC,
TRAILER1=('FT',DATE,55X,COUNT=(EDIT=(IIITT)),
299X,TOTAL=(370,13,SFF,EDIT=(STTTTTTTTT.TT),
SIGNS=(+,-),
LENGTH=13))
I have a Trailer record with the above options. In this scenario, the date is displayed in the format but I want the date to be displayed in the format 2014-10-21 only. My trailer record will look like below.
FT10/21/14 04 +000000192.21
It should be like below. FT2014-10-21 04 +000000192.21
Also, in this one I have found the Count of all the records and the total of all records. My input file has A or L in column 2 and corresponding amounts in coloumn 370. I also want find the count of the records that have A or L in column 2 and also the total of those records. I have to display this count and sum in the trailer record too. Experts help needed urgently.
Note : In my trailer, I need to display the current date in the format yyyy-mm-dd and I am already displaying the count and total of all the input records, I also want to display the count and total of the records with A or L in column 2 and the total of the corresponding amounts in column 370.
Based on the answer provided by Bill, this is what I have.
//SORTA EXEC PGM=SORT
//SORTIN DD DSN=TESTIBN.MYFILE.CHGHIS.SAMP,
// DISP=SHR
//SORTOUT DD DSN=TESTIBN.MYFILE.CHGHIS.NEW,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// RECFM=FB
//SORTWK01 DD SPACE=(CYL,(364)),
// UNIT=SYSDA
//SORTWK02 DD SPACE=(CYL,(364)),
// UNIT=SYSDA
//SORTWK03 DD SPACE=(CYL,(364)),
// UNIT=SYSDA
//SORTWK04 DD SPACE=(CYL,(364)),
// UNIT=SYSDA
//SORTWK05 DD SPACE=(CYL,(364)),
// UNIT=SYSDA
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
TRAILER1=('FT',DATE=(4MD-),55X,COUNT=(EDIT=(IIITT)),
299X,TOTAL=(370,13,SFF,EDIT=(STTTTTTTTT.TT),
SIGNS=(+,-),
LENGTH=13))
Yes, the record length is 500. The input file has A or L in position 2 only for few records. These are adjustment records. They may have C in position 2 for charge records. I have already put the totals of all the records (charge+adjustments) in the trailer, now I have to put the count and total of the adjustment records as well. Kindly help me with the actual code.