MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

date time check on a step

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
anita_m
Beginner


Joined: 20 Sep 2006
Posts: 41
Topics: 12
Location: Venus

PostPosted: Mon Jan 07, 2008 12:45 pm    Post subject: date time check on a step Reply with quote

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
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Jan 07, 2008 2:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Mon Jan 07, 2008 2:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
anita_m
Beginner


Joined: 20 Sep 2006
Posts: 41
Topics: 12
Location: Venus

PostPosted: Mon Jan 07, 2008 4:05 pm    Post subject: Reply with quote

I wanted to know if there is a way to do this without the help of a program or scheduler.
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Tue Jan 08, 2008 12:52 am    Post subject: Reply with quote

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
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Jan 08, 2008 9:28 am    Post subject: Reply with quote

I tried this with DFSORT and got RC=0 both ways. Sad 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
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Tue Jan 08, 2008 10:07 am    Post subject: Reply with quote

Bill Dennis wrote:
I tried this with DFSORT and got RC=0 both ways. Sad 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
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Jan 08, 2008 11:37 am    Post subject: Reply with quote

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
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Wed Jan 09, 2008 3:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Jan 16, 2008 11:30 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Wed Jan 16, 2008 10:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Jan 17, 2008 4:52 am    Post subject: Reply with quote

krisprems,
Try this:
Code:
 OPTION NULLOUT=RC16,COPY         
 OUTFIL FNAMES=SORTOUT,NULLOFL=RC4


Change OUT to SORTOUT in the JCL.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group