IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to add header with Date(YYMMDD) in the output file ?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rajan Moorthy
Warnings : 1

New User


Joined: 04 Jun 2007
Posts: 11
Location: Chennai

PostPosted: Thu Jul 06, 2017 11:44 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8574
Location: Dubuque, Iowa, USA

PostPosted: Fri Jul 07, 2017 12:17 am
Reply with quote

Did you search for DATE and YYMMDD? If so, you should have found ibmmainframes.com/about52881.html which has exactly what you need.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1080

PostPosted: Fri Jul 07, 2017 2:36 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts COBOL Table data to a flat file with ... COBOL Programming 5
No new posts Compare 2 files replace data in 1st f... DFSORT/ICETOOL 4
No new posts Connect:Direct Add yesterday date in ... All Other Mainframe Topics 3
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
No new posts DB2 SQL query to read and update data... DB2 12
Search our Forums:

Back to Top