MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Yesterday's date in Header

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sunz
Beginner


Joined: 22 Feb 2011
Posts: 6
Topics: 3

PostPosted: Wed Feb 23, 2011 3:41 pm    Post subject: Yesterday's date in Header Reply with quote

Hi

My requirement is to get the Previous Day's date in the Output report. I understand that Date1 variation cannot be used in the Header. Is there any other function that can be used to get the desired result. Thank you.
Code:

//SORT0001 EXEC PGM=SORT                                 
//SORTIN   DD  DSN=file1,                         
//             DISP=SHR                                   
//         DD  DSN=file2,                         
//             DISP=SHR                                   
//         DD  DSN=file3,                         
//             DISP=SHR                                   
//*                                                       
//SORTOUT  DD DSN=Outputfile,DISP=SHR                   
//SYSOUT   DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=(17,4,CH,A,34,1,CH,D),EQUALS               
  OUTFIL REMOVECC,                                       
  HEADER1=('           STATUS FOR THE DATE - ',DATE=(4MD-)),
  HEADER2=('           ********************************')
/*                                                       


Output should be like
Code:


    STATUS FOR THE DATE - (Current Date - 1)
    ************************************
Records of file1,2,3
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Wed Feb 23, 2011 3:51 pm    Post subject: Reply with quote

sunz,

Assuming your input lrecl is 80 and recfm Fb , the following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                   
A                                                 
B                                                 
C                                                 
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                   
  SORT FIELDS=(17,4,CH,A,34,1,CH,D),EQUALS       
  OUTREC OVERLAY=(81:DATE1(-)-1)                 
  OUTFIL BUILD=(1,80),REMOVECC,                   
  HEADER1=(12:'STATUS FOR THE DATE - ',81,10),   
  HEADER2=(12:32'*')                             
//*


The output is
Code:

           STATUS FOR THE DATE - 2011-02-22       
           ********************************       
A                                                 
B                                                 
C                                                 

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sunz
Beginner


Joined: 22 Feb 2011
Posts: 6
Topics: 3

PostPosted: Wed Feb 23, 2011 3:58 pm    Post subject: Reply with quote

Kolusu

Thank you so much. It worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group