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
 

 

Check System time(Minute) Using TIME1 function

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

New User


Joined: 29 Jun 2005
Posts: 86

PostPosted: Fri Nov 11, 2016 10:53 am    Post subject: Check System time(Minute) Using TIME1 function
Reply with quote

Hi,

I have a file triggered job and it will process set of steps if current minute is less than or equal to 30 minutes otherwise it will process another set of steps in the JCL. This can be achieved by having a step to fetch current time from the db2 table and compare current minute with Value "30" and with help of IF/ELSE we can execute the desired steps.

I want to know if this can be achieved using TIME1 or any time builtin function in DFSORT to check the system time(minute) .

I found some examples using TIME1 but it is used to have values with the format (C'HHMMSS') while building the data in the output file .

Please advise.
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Fri Nov 11, 2016 12:15 pm    Post subject:
Reply with quote

So you want to know how to pull minutes out of TIME1 or TIMENS(24) Format and the check cond less than 30 and set some RC ?
Back to top
View user's profile Send private message
balaji81_k

New User


Joined: 29 Jun 2005
Posts: 86

PostPosted: Fri Nov 11, 2016 12:22 pm    Post subject:
Reply with quote

Yes Rohit
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Nov 11, 2016 5:06 pm    Post subject:
Reply with quote

I'm not sure if this would be of use.

Code:
//         EXEC PGM=ICEMAN                                   
//*                                                         
//SYSOUT   DD SYSOUT=*                                       
//SYSPRINT DD SYSOUT=*                                       
//SORTIN   DD *                                             
  dummy record                                               
//SORTOUT  DD DISP=(,PASS),DSN=&&WRK1,UNIT=SYSDA             
//SYSIN    DD *                                             
*                                                           
  OPTION COPY                                               
*                                                           
  INREC BUILD=(3:TIME1,80:X)                                 
*                                                           
* If minutes < 30 then build two records                   
*  else build single record                                   
*                                                           
  OUTFIL IFTHEN=(WHEN=(5,2,CH,LT,C'30'),                     
          BUILD=(1:3,6,80:X,/,1:3,6,80:X)),                 
         IFTHEN=(WHEN=(5,2,CH,GE,C'30'),                     
          BUILD=(1:3,6,80:X))                               
*                                                           
//*                                                         
//TOOL     EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//TARDIS   DD DISP=(OLD,PASS),DSN=&&WRK1                     
//TOOLIN   DD *                                   
*                                                 
* If count > 1 cond code = 4                       
*   else cond code = 0                             
*                                                 
 COUNT FROM(TARDIS) RC4 HIGHER(1)                 
*                                                 
//IF4      IF  (TOOL.RC ¬= 4) THEN                 
//*                                               
//ONEREC   EXEC PGM=ICEGENER                       
//SYSPRINT DD SYSOUT=*                             
//SYSUT1   DD DISP=(OLD,PASS),DSN=&&WRK1           
//SYSUT2   DD SYSOUT=*                             
//SYSIN    DD DUMMY                               
//*                                               
//         ELSE                                   
//*                                               
//TWOREC   EXEC PGM=ICEGENER                       
//SYSPRINT DD SYSOUT=*                             
//SYSUT1   DD DISP=(OLD,PASS),DSN=&&WRK1           
//SYSUT2   DD SYSOUT=*                             
//SYSIN    DD DUMMY                               
//*                                               
//         ENDIF                                   


Simply builds one or two records in a temp dataset, dependent on the minutes returned by TIME1. Then, checks the number of records generated to set the cond code for further processing.

The value in the generated records is unimportant and only there for demonstration purposes.


Garry.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2164
Location: @my desk

PostPosted: Fri Nov 11, 2016 10:00 pm    Post subject:
Reply with quote

An alternative as hinted by Rohit above is, to use TIME1 in INREC and evaluate the minute part to INCLUDE the record in OUTFIL checking if minutes part is greater than 30, and issue RC4 if empty using the NULLOFL parameter.
So you get RC4 if min <= 30 and RC0 if min > 30.
Back to top
View user's profile Send private message
balaji81_k

New User


Joined: 29 Jun 2005
Posts: 86

PostPosted: Tue Nov 29, 2016 10:36 pm    Post subject: Thankyou
Reply with quote

Hi Every one,

Many thanks for your suggestion and ideas . I have done by using SORT
by capturing time using &TIME and along with populating 'Y' .
One more file created to have 'Y' only if time(minute ) > 30 . Based on the file status (empty or not) logic will handle accordingly .
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 IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm


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