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

yyyymm value in Header option


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Mar 12, 2007 1:05 pm
Reply with quote

Hi all,

One of my step in the job generates a monthly report for the previous month (i.e., if the job is executed during March-2007, it generates report for the month of Feb-07).

Now my requirement is to put month and year (in yyyymm) in the report header (using header1 option).

I tried using date=(4md/), but it is inserting the current (system) date. Is it possible to write the previous month (i.e., 200702 in the header as per example given above).

Regards,
Murali
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 12, 2007 8:25 pm
Reply with quote

You can do what you want with a DFSORT job like this. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's DATE2-d function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

Use [URL] BBCode for External Links

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT symbol as follows:
* PREVMON,'yyyymm'
* where mm is the current month - 1
  INREC BUILD=(C'PREVMON,''',DATE2-1,C'''',80:X)
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
* Use PREVMON in HEADER
  OUTFIL HEADER1=(PREVMON,...)
/*
Back to top
View user's profile Send private message
dineshness

New User


Joined: 25 Dec 2006
Posts: 63
Location: Perambalur

PostPosted: Tue Mar 13, 2007 12:00 am
Reply with quote

Frank,

Can't the date arithmetic be "DATE2-1" directly used in HEADER1?.

Dinesh.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 13, 2007 12:49 am
Reply with quote

Quote:
Can't the date arithmetic be "DATE2-1" directly used in HEADER1?.


No. DATEn and variations are supported in BUILD, OVERLAY, COND, INCLUDE, OMIT and WHEN, but NOT in HEADERx or TRAILERx.
DATE=(...) and variations are supported in BUILD, OVERLAY, HEADERx and TRAILERx but there are no - or + forms for those variations.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 13, 2007 8:44 am
Reply with quote

Thanks Frank for the solution.
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 SCOPE PENDING option -check data DB2 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts CICS vs LE: STORAGE option CICS 0
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts INSYNC option with same function as I... JCL & VSAM 0
Search our Forums:

Back to Top