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: 7
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: 8187
Location: East Dubuque, Illinois, 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: 212
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 Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am

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