|
View previous topic :: View next topic
|
| Author |
Message |
Rajan Moorthy Warnings : 1 New User
Joined: 04 Jun 2007 Posts: 11 Location: Chennai
|
|
|
|
Hi All,
Good Morning. I have only detail records in an 80 char fixed length input file. I wants to write output(83 bytes) file with Header(with Date in YYMMDD format) ,Details records and Trailer with counts(Only detail records count).
Thanks in advance. I tried using Header1 and Date1, But i count not reformat date into YYMMDD format.
Input file - 80 bytes - FB.
Region#(1 to 6) Card #(7 to 24), Customer name(25 to 34) Spaces(35 to 80)
XXXXXX123456789012345678GEORGE W.T
XXXXXX987654321012345678ORGNGE TBD
Expected Output file. - 83 Bytes - FB.
HDR+ 6 spaces + 18 zeroes + Date in YYMMDD format + Spaces
BDY + Input 1st rec.
BDY + Input 1st rec.
TRL + 6 spaces + 18 nines + detail record count + Spaces
HDR 000000000000000000170707
BDYXXXXXX123456789012345678GEORGE W.T
BDYXXXXXX987654321012345678ORGNGE TBD
TRL 9999999999999999990000000002
Thanks,
Rajan M. |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2290 Location: USA
|
|
|
|
| Quote: |
HDR+ 6 spaces + 18 zeroes + Date in YYMMDD format + Spaces
BDY + Input 1st rec.
BDY + Input 1st rec.
TRL + 6 spaces + 18 nines + detail record count + Spaces |
| Code: |
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=(C'HDR',
6X,18C'0',
&DATE=(YMD)),
BUILD=(C'BDY',1,80),
TRAILER1=(C'TRL',
6X,18C'9',
COUNT=(EDIT=(TTTTTT)))
END |
I guess, that's it.
Free of charge. |
|
| Back to top |
|
 |
|
|