View previous topic :: View next topic |
Author |
Message |
anita_m Beginner
Joined: 20 Sep 2006 Posts: 41 Topics: 12 Location: Venus
|
Posted: Mon Jan 07, 2008 12:45 pm Post subject: date time check on a step |
|
|
Hi!
Is there a way to prevent a step from executing when the date and the time exceed a particular limit? The date and time are going to be fixed.
There are few steps in the JCL I would like to avoid running based on 'If date > Jan 07 and time > 11:06'
Thank you. |
|
Back to top |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Mon Jan 07, 2008 2:07 pm Post subject: |
|
|
Sure. Write a program to check the current system date and time. If the values fall within your parameters, end the program with a non-zero RETURN-CODE.
Check for that return-code value for that step. |
|
Back to top |
|
|
CraigG Intermediate
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
|
Posted: Mon Jan 07, 2008 2:28 pm Post subject: |
|
|
You could also add the date/time check to the individual programs for each step.
If this is a process that is controlled by a scheduling system then set up 2 jobs and let the the scheduler handle the date/time check, that is what they are for. |
|
Back to top |
|
|
anita_m Beginner
Joined: 20 Sep 2006 Posts: 41 Topics: 12 Location: Venus
|
Posted: Mon Jan 07, 2008 4:05 pm Post subject: |
|
|
I wanted to know if there is a way to do this without the help of a program or scheduler. |
|
Back to top |
|
|
krisprems Beginner
Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Tue Jan 08, 2008 12:52 am Post subject: |
|
|
Hi
You can do this using SORT.
Below SORT JOB returns RC=0 'If date > Jan 07 and time > 11:06' else the JOB returns RC=4.
So for the Further steps you can capture the Return code and execute the further steps as needed.
Code: | //*******************************************************
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY
/*
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY,NULLOUT=RC4
INREC IFTHEN=(WHEN=INIT,OVERLAY=(DATE1,TIME1))
OUTFIL INCLUDE=(5,8,ZD,GT,+01071106)
/*
|
In the above SORT card i have hard coded the Fixed date and time as you have specified...,+01071106
here Code: | 01 -> Jan
07 -> date
11 -> Hours
06 -> minutes |
If you find difficulty in running/using this please tell us what SORT product you are using (DFSORT or SYNCSORT?). So that Frank/Kolusu may help you in case of DFSORT!!! _________________ cHEERs
krisprems |
|
Back to top |
|
|
Bill Dennis Advanced
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Jan 08, 2008 9:28 am Post subject: |
|
|
I tried this with DFSORT and got RC=0 both ways. SYSOUT shows NULLOUT=RC4 but I got ICE174I msg for NULLOUT=RC0 !
SYNCSORT works fine. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
|
krisprems Beginner
Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Tue Jan 08, 2008 10:07 am Post subject: |
|
|
Bill Dennis wrote: | I tried this with DFSORT and got RC=0 both ways. SYSOUT shows NULLOUT=RC4 but I got ICE174I msg for NULLOUT=RC0 !
SYNCSORT works fine. | You have both DFSORT and SYNCSORT at your site???
If you can try with DFSORT , try this..
Code: | //*******************************************************
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY
/*
//OUT DD DUMMY
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(DATE1,TIME1))
OUTFIL FNAMES=OUT,NULLOFL=RC4,INCLUDE=(5,8,ZD,GT,+01071106)
/* |
_________________ cHEERs
krisprems |
|
Back to top |
|
|
Bill Dennis Advanced
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Jan 08, 2008 11:37 am Post subject: |
|
|
krisprems,
your DFSORT solution works fine.
We have both products because we rely heavily on SYNCSORT MAXSORT for our fluctuating production file sizes. DFSORT is used for "regular" sort workload. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
|
krisprems Beginner
Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Wed Jan 09, 2008 3:58 am Post subject: |
|
|
Sounds good, Bill. I was very curious to know why 2 SORT products were really required.
Frank/Kolusu,
Can you let us know how to set the RC4 using NULLOUT in DFSORT. _________________ cHEERs
krisprems |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed Jan 16, 2008 11:30 am Post subject: |
|
|
For DFSORT, NULLOFL applies to the OUTFIL data set for which it is specified (even if it has the ddname SORTOUT). NULLOUT applies to the non-OUTFIL data set (and not to any OUTFIL data set).
I think Syncsort has NULLOUT apply to a data set with the ddname of SORTOUT even if it's an OUTFIL data set but not to an OUTFIL data set with any other ddname.
So I'm guessing that for Syncsort:
Code: |
OPTION NULLOUT=RC16
OUTFIL FNAMES=SORTOUT
OUTFIL FNAMES=OUT1
OUTFIL FNAMES=OUT2,NULLOFL=RC4
|
NULLOUT=RC16 applies to the SORTOUT OUTFIL data set, but not the OUT1 or OUT2 OUTFIL data sets, whereas NULLOFL=RC4 applies to the OUT2 data set.
With DFSORT, NULLOUT=RC16 does NOT apply to any of the OUTFIL data sets. NULLOFL=RC4 applies to the OUT2 data set.
I don't know what Syncsort does if you have:
Code: |
OPTION NULLOUT=RC16
OUTFIL FNAMES=SORTOUT,NULLOFL=RC4
|
With DFSORT, NULLOFL=RC4 applies to the SORTOUT OUTFIL data set; NULLOUT=RC16 doesn't.
I'll leave it to you all to decide which way is more consistent. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
krisprems Beginner
Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Wed Jan 16, 2008 10:12 pm Post subject: |
|
|
Frank Yaeger,
Thanks for your response Frank
Quote: |
I don't know what Syncsort does if you have:
Code: | OPTION NULLOUT=RC16
OUTFIL FNAMES=SORTOUT,NULLOFL=RC4 |
With DFSORT, NULLOFL=RC4 applies to the SORTOUT OUTFIL data set; NULLOUT=RC16 doesn't.
|
I tried this with SYNCSORT and it gives RC=16 _________________ cHEERs
krisprems |
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Thu Jan 17, 2008 4:52 am Post subject: |
|
|
krisprems,
Try this:
Code: | OPTION NULLOUT=RC16,COPY
OUTFIL FNAMES=SORTOUT,NULLOFL=RC4 |
Change OUT to SORTOUT in the JCL. |
|
Back to top |
|
|
|
|