Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to include date from the reference file to header

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jegan_selvan

New User


Joined: 23 Oct 2006
Posts: 24
Location: India

PostPosted: Thu Apr 12, 2012 6:14 pm    Post subject: Need to include date from the reference file to header
Reply with quote

The input file has a record length of 80 FB (This will contain only detail records). I have another input file which has the date with format CCYYMMDD in the first position with record length 80 and FB.

My requirement is to add a header and trailer record as follows.

HDRCCYYMMDD
Detail record1
Detail record2
Detail record3
TRL00003

where CCYYMMDD ( Date from Reference file)
TRL will contain the count of detail record.

Regards,

Jegan S
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Apr 12, 2012 6:24 pm    Post subject: Reply to: Need to include date from the reference file to he
Reply with quote

There is another requirement today that is looking to use a single-record file, Have a look for that to get your date available.

To create a header and a trailer, look at HEADER1 and TRAILER1 on OUTFIL. There are examples in the forum.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Thu Apr 12, 2012 7:26 pm    Post subject:
Reply with quote

jegan_selvan,

real quick without much of a testing, see if below helps...
Code:
//STEP0001     EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
CCYYMMDD                                               
/*                                                     
//         DD *                                         
DETAIL RECORD1                                         
DETAIL RECORD2                                         
DETAIL RECORD3                                         
/*                                                     
//SORTOUT  DD  SYSOUT=*                                 
//SYSIN    DD *                                         
  INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(81:1,8))     
  OPTION COPY                                           
  OUTFIL REMOVECC,STARTREC=2,BUILD=(1,80),             
                  HEADER1=('HDR',81,8),                 
                 TRAILER1=('TRL',COUNT=(M11,LENGTH=05))
/*                                                     

OUTPUT
Code:
HDRCCYYMMDD   
DETAIL RECORD1
DETAIL RECORD2
DETAIL RECORD3
TRL00003     

Thanks,
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Apr 12, 2012 7:56 pm    Post subject: Reply to: Need to include date from the reference file to he
Reply with quote

Or, to add when you've copied the code to generate the symbol/SYMNAMES:

Code:
//STEP0001     EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
DETAIL RECORD1
DETAIL RECORD2
DETAIL RECORD3
/*
//SYMNAMES DD * replace this with your dsn and ditch the single line of data beneath
DATE-FROM-FILE,C'CCYYMMDD'
//SORTOUT  DD  SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  OUTFIL REMOVECC,
                  HEADER1=('HDR',DATE-FROM-FILE),
                 TRAILER1=('TRL',COUNT=(M11,LENGTH=05))


Output is:

Code:
HDRCCYYMMDD   
DETAIL RECORD1
DETAIL RECORD2
DETAIL RECORD3
TRL00003     
Back to top
View user's profile Send private message
jegan_selvan

New User


Joined: 23 Oct 2006
Posts: 24
Location: India

PostPosted: Mon Apr 16, 2012 6:10 pm    Post subject: Reply to: Need to include date from the reference file to he
Reply with quote

Hi All,

Thanks for your reply and it worked fine.

Regards,

Jegan S
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts StreamWeaver language reference chetanambi Compuware & Other Tools 1 Wed Jul 05, 2017 12:50 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us