View previous topic :: View next topic
|
Author |
Message |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3038 Location: NYC,USA
|
|
|
|
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 |
|
 |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
Yes Rohit |
|
Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1189 Location: Dublin, Ireland
|
|
|
|
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 |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
 |
balaji81_k
Active User
Joined: 29 Jun 2005 Posts: 155
|
|
|
|
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 |
|
 |
|