Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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

Active User


Joined: 29 Jun 2005
Posts: 118

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: 1806
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

Active User


Joined: 29 Jun 2005
Posts: 118

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: 998
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: 2285
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

Active User


Joined: 29 Jun 2005
Posts: 118

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
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us