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
 

 

Can system date/YYYY be changed?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Can system date/YYYY be changed?
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 Moderator


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

PostPosted: Mon Jul 14, 2008 9:38 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jul 15, 2008 1:01 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jul 15, 2008 1:32 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jul 15, 2008 2:52 am    Post subject:
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    Post subject:
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    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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm


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