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

Can system date/YYYY be changed?


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

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Mon Jul 14, 2008 8:57 pm
Reply with quote

Using ICEMAN, the following statement gives year in YYYY format.

//SYMNAMES DD *
CUR_YEAR,S'&YR4'

Can the year(YYYY) be returned as 2009 between July 1, 2008 and December 31, 2008 (as July 1 is beginning of fiscal year 2009) ?
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 Jul 14, 2008 9:38 pm
Reply with quote

What year would you want between Jan, 2008 and June, 2008?

What year would you want between Jan, 2009 and June, 2009?

Do you really need to check the month and day (e.g. Dec 31) or would just checking the month do as well (e.g. Dec)?
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Mon Jul 14, 2008 10:59 pm
Reply with quote

Frank,

1.What year would you want between Jan, 2008 and June, 2008?

Year 2008.

2. What year would you want between Jan, 2009 and June, 2009?

Year 2009

3. Between Jul, 2008 and Dec 2008, YYYY will be 2009.
4. Between Jul, 2009 and Dec 2009, YYYY will be 2010.

Do you really need to check the month and day (e.g. Dec 31) or would just checking the month do as well (e.g. Dec)?

Just checking the month (Dec) only will be enough.

thanks.
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 Jul 15, 2008 1:01 am
Reply with quote

You can use a DFSORT job like this to create the symbol you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
DUMMY RECORD
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=80,
   IFTHEN=(WHEN=INIT,BUILD=(DATE2)),
   IFTHEN=(WHEN=(5,2,ZD,LE,06),
     BUILD=(C'CUR_YEAR,''',1,4,C'''')),
   IFTHEN=(WHEN=NONE,
     BUILD=(C'CUR_YEAR,''',1,4,ZD,ADD,+1,EDIT=(TTTT),C''''))
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)   Has CUR-YEAR symbol
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
...
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Tue Jul 15, 2008 1:22 am
Reply with quote

Frank,

From your example above, in the following code - does RECORD refer to the input record?

If so, can the 'system year'(YYYY) be taken as input (instead of input record/file), and then the logic to add 1 be applied (i.e. add 1 if month falls between July and December) ?

//SORTIN DD *
RECORD
/*
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 Jul 15, 2008 1:32 am
Reply with quote

No, RECORD in S1 is just a dummy record. We just need that one record (it can be anything) to create the DATE2 record of yyyymm so we can manipulate it.

The S2 step would have your actual input records.

I've modified the job to make that clearer.
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Tue Jul 15, 2008 1:46 am
Reply with quote

Maybe I am missing something, but I get errors, let me try some more...please let me know.

Code:

DFSort version is '5694-A01, Z/OS DFSORT V1R5'

          INREC IFOUTLEN=80,
                $
ICE005A 0 STATEMENT DEFINER ERROR
          IFTHEN=(WHEN=INIT,BUILD=(DATE2)),
          IFTHEN=(WHEN=(5,2,ZD,LE,06),
             BUILD=(C'CUR_YEAR,''',1,4,C'''')),
             $
ICE005A 0 STATEMENT DEFINER ERROR
          IFTHEN=(WHEN=NONE,
             BUILD=(C'CUR_YEAR,''',1,4,ZD,ADD,+1,EDIT=(TTTT),C''''))
             $
ICE005A 0 STATEMENT DEFINER ERROR
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
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 Jul 15, 2008 2:52 am
Reply with quote

Sigh. The ICE005A message indicates you started INREC in column 1. Look at my example again. Every line starts with at least one blank. Shift all of your DFSORT control statements over at least one column:

Code:

1234...
 OPTION COPY
 INREC IFOUTLEN=80,
  IFTHEN=(WHEN=INIT,BUILD=(DATE2)),
  IFTHEN=(WHEN=(5,2,ZD,LE,06),
    BUILD=(C'CUR_YEAR,''',1,4,C'''')),
  IFTHEN=(WHEN=NONE,
    BUILD=(C'CUR_YEAR,''',1,4,ZD,ADD,+1,EDIT=(TTTT),C''''))


It also appears you don't have the OPTION COPY statement that I have in my example.
Back to top
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Tue Jul 15, 2008 7:02 pm
Reply with quote

Thanks Frank, that works.
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top