Page 1 of 1

Can we compare time fields in sort card of jcl

PostPosted: Wed May 22, 2013 7:49 pm
by deva_048
Hi,

Input file contains

SSSSSSSSSSSSSSS
JobA  00:31
JobB  00:51
Job time information listed above.


I need to validate the jobA time is greater than 02:00 means output file should look like below format

SSSSSSSSSSSSSSS
JOBA 00:31
JOBB 00:51
Jobs are in progress


Is it possible??

Thanks..

Re: Can we compare time fields in sort card of jcl

PostPosted: Wed May 22, 2013 8:03 pm
by Pandora-Box
But JOBA is not greater than 02:00 ?

Please explain

Re: Can we compare time fields in sort card of jcl

PostPosted: Wed May 22, 2013 8:06 pm
by BillyBoyo
Yes. Always with times, you'll inevitably need the date as well, if anything can ever occur around midnight.

In the bland instance that you have, there is no problem with comparing "00:31" or "00:51" to "02:00", you just do it is CHaracter fields. Because the ":" is in a fixed position in all cases and because the characters decrease in significance right-to-left, it'll work - until you cross midnight.

Re: Can we compare time fields in sort card of jcl

PostPosted: Wed May 22, 2013 8:29 pm
by deva_048
If it is not greater than 02:00 output file should be in below format

SSSSSSSSSSSSSSS
JOBA 00:31
JOBB 00:51
Jobs completed

Billy, can you explain me in the code..

Re: Can we compare time fields in sort card of jcl

PostPosted: Wed May 22, 2013 8:43 pm
by BillyBoyo
Where are you getting the time from?

Re: Can we compare time fields in sort card of jcl

PostPosted: Wed May 22, 2013 8:59 pm
by deva_048
JESMSGLG info will be extracted into i/p dataset

Re: Can we compare time fields in sort card of jcl

PostPosted: Wed May 22, 2013 9:51 pm
by BillyBoyo
:-)

I mean, the "02:00", which is presumably not a "static" value, but one you want to change?

Re: Can we compare time fields in sort card of jcl

PostPosted: Thu May 23, 2013 7:08 am
by deva_048
02:00 is a constant value. We need to validate the input with this time 02:00 or whatever the time we are given it need to validate with input.

Re: Can we compare time fields in sort card of jcl

PostPosted: Thu May 23, 2013 11:50 am
by BillyBoyo
OK, we'll perhaps need more detail about exactly what you want, but:

Define the time-to-compare-to as a symbol, on the SYMNAMES DD statement. Include a SYMNOUT DD statement so that you get a listing of the "normalised" symbols.


//SYMNAMES DD *
TIME-TO-COMPARE-TO,C'02:00'
//SYMOUNT DD SYSOUT=*


  INREC IFTHEN=(WHEN=(10,5,CH,LT,TIME-TO-COMPARE-TO),
              OVERLAY=(40:C'BANANA'))


This is just to show the comparison. Expect it to appear in unexpected places.

To get the information from the detail line to the final line, again it will need GROUP and PUSH. But we need more information.

Is it just two jobs, always, involved, or what?

If one is complete and the other not, what do you want?