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

Check System time(Minute) Using TIME1 function


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

Active User


Joined: 29 Jun 2005
Posts: 141

PostPosted: Fri Nov 11, 2016 10:53 am
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

Global Moderator


Joined: 21 Sep 2010
Posts: 2632
Location: NYC,USA

PostPosted: Fri Nov 11, 2016 12:15 pm
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

Active User


Joined: 29 Jun 2005
Posts: 141

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

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

Senior Member


Joined: 08 May 2006
Posts: 1104
Location: Dublin, Ireland

PostPosted: Fri Nov 11, 2016 5:06 pm
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: 2481
Location: @my desk

PostPosted: Fri Nov 11, 2016 10:00 pm
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

Active User


Joined: 29 Jun 2005
Posts: 141

PostPosted: Tue Nov 29, 2016 10:36 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Cobol-db2 : SQL query is running for ... DB2 4
No new posts Control M features to check string in... Compuware & Other Tools 1
No new posts Numeric check w/SyncSort. SYNCSORT 1
No new posts Modify Several JCLs at the Same Time JCL & VSAM 6
No new posts Looking for mainframe system programmers Mainframe Jobs 0
Search our Forums:

Back to Top