Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to add header with Date(YYMMDD) in the output file ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to add header with Date(YYMMDD) in the output file ?
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: 8404
Location: Dubuque, Iowa, USA

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

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

Active User


Joined: 29 Apr 2008
Posts: 377
Location: Maryland

PostPosted: Fri Jul 07, 2017 2:36 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 0 Tue Nov 13, 2018 7:55 pm
No new posts Will this code extract 1 byte from fi... pkmurali CLIST & REXX 8 Sat Nov 10, 2018 11:13 pm
No new posts REFORMATTING WITH JFY CLOBBERING OUTP... speermb DFSORT/ICETOOL 10 Thu Nov 08, 2018 7:20 pm
No new posts Error reading file in REXX module ashek15 CLIST & REXX 3 Wed Oct 24, 2018 4:50 am
No new posts Convert VB file to FB plus special fo... cz016m SYNCSORT 15 Fri Oct 19, 2018 7:26 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us