IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JES2 command correction required.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Apr 13, 2011 1:40 pm
Reply with quote

Hi,

I am trying to submit a job at a particular time using JES2 $TA command.
Tried out the below command but the job is not being submitted at the specified time. Could you please let me know the correct syntax for the command,
Code:

/$TA,T=04.00,'$VS,"S JOB,MBR=DFSORT"'

requirement is to run the job "DFSORT" located in one of my PDS at 04:00 AM.

I allocated the source PDS to SYSPROC and placed the DFSORT member inside it. I am unable to see any error messages as well.

The manual says that S JOB is a jes command to start a job, but I am not sure how to specify the location of the job on the command itself. Please let me know your thoughts.

Thanks in advance,
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Apr 13, 2011 1:59 pm
Reply with quote

I believe that the JCL needs to reside in one of the PROCLIBS defined to the JES subsystem.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Apr 13, 2011 2:02 pm
Reply with quote

icon_eek.gif oh ok, thanks for clarifying the point, i got mixed up with PROCLIBS of JES and my SYSPROCS.

Regards,
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Apr 13, 2011 3:19 pm
Reply with quote

Hi,

Im stuck with another obstacle with JES 2 command structure,
I tried to couple the $TA with $A command, but facing issues with " and '

The $A command for releasing jobs,

Code:
$A 'JOBNAME'

works fine with a single quote but does not work with double quotes around jobname.

Code:
/$TA,T=05.40,'COMMAND'

works fine with single quotes and does not work with double quotes.

when trying to combine both of these there is a conflict between single quotes,
Code:
$TA,T=05.40,'$A 'JOBNAME''


Please let me know how to correct this.

Thanks,
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Apr 13, 2011 3:27 pm
Reply with quote

ibmmainframes.com/viewtopic.php?t=927
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Apr 13, 2011 3:30 pm
Reply with quote

Hi Peter, I referred to that link before posting, the link says

Quote:
3. Modification of #2. Submit your job with "TYPRUN=HOLD". Then, use the "$TA" JES2 command to schedule a command to release your job at a specified time (the "$A" command). Of course, your job would then have to reload itself with the "TYPRUN=HOLD" enabled for the next runtime.


so I am trying out that command. but stuck with the usage of " and '.
I was dropped on my head several times when I was kid, maybe thats why im unable to figure it out icon_biggrin.gif

Thanks,
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Apr 13, 2011 4:19 pm
Reply with quote

Maybe the JES2 commands manual will take care of your head ache.
Back to top
View user's profile Send private message
nevilh

Active User


Joined: 01 Sep 2006
Posts: 262

PostPosted: Wed Apr 13, 2011 4:30 pm
Reply with quote

A simple $TA,T=05.40,'$AJ(jobname)' should be enough
Back to top
View user's profile Send private message
nevilh

Active User


Joined: 01 Sep 2006
Posts: 262

PostPosted: Wed Apr 13, 2011 4:39 pm
Reply with quote

A word of warning JES will issue the command once and then forget it. If you want the command to be issued daily you will have to set up the process to reinitialise every 24 hours and at every jes restart
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Apr 13, 2011 4:44 pm
Reply with quote

Thank you very much Nevil, your suggestion worked well.
icon_biggrin.gif

Quote:
A word of warning JES will issue the command once and then forget it. If you want the command to be issued daily you will have to set up the process to reinitialise every 24 hours and at every jes restart


I will keep this in mind.

Thanks again,
Back to top
View user's profile Send private message
tatasteed

New User


Joined: 18 Sep 2007
Posts: 8
Location: Santiago de Chile

PostPosted: Fri Apr 15, 2011 1:25 am
Reply with quote

Hi...
How can I produce a log with the following information when a jcl is submitted:
-Proc's invoked by the JCL
-JCL name
-Userid
-System date.

I have been told that it can be possible using JES2 exit but that is far beyond my knowledge.

Thanks in advance!
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Apr 15, 2011 11:20 am
Reply with quote

Hello,

If you are familiar with REXX, then this could be done with the below JCL & program,
Code:


//JS010    EXEC PGM=IKJEFT1B           
//SYSPRINT DD SYSOUT=*                 
//SYSTSPBD DD SYSOUT=Y                 
//SYSTSPRT DD SYSOUT=Y                 
//SYSEXEC  DD DSN=WELLS.GREEN.DAY,DISP=SHR
//SYSTSIN  DD *                         
%RAJNI                               
/*       


The PDS WELLS.GREEN.DAY should have a member called RAJNI with the below contents inside,

Code:
/*REXX*/               
NOW = DATE();      /*CURRENT DATE*/                                                 
ASCB = C2D(STORAGE(224,4))                                             
ASSB = C2D(STORAGE(D2X(ASCB+336),4))                                   
JSAB = C2D(STORAGE(D2X(ASSB+168),4))                                   
JOBNAME = STORAGE(D2X(JSAB+28),8)            /* JOBNAME           */   
JOBNUM  = STORAGE(D2X(JSAB+20),8)            /* JOB #             */   
USERID  = STORAGE(D2X(JSAB+44),8)            /* USERID            */   
PTR2PSA = 0                                                             
CVTPTR = STORAGE(D2X(PTR2PSA + 16),4)                                   
CVTSMCA = STORAGE(D2X(C2D(CVTPTR)+197),3)                               
SMFID   = STORAGE(D2X(C2D(CVTSMCA)+16),4)    /* SYSID             */   
 /*CRLF = X2C('0D0A')  ASCII   */                                       
   CRLF = X2C('0D25') /*EBCIDIC */                                     
SAY 'JOBNAME  IS ' JOBNAME                                             
SAY 'JOBNUM IS   ' JOBNUM                                               
SAY 'USERID IS   ' USERID                                               
SAY 'SMFID IS    ' SMFID                                               
SAY 'DATE IS ' NOW
EXIT                                                                   


The JOBNAME and USERID will be present inside the variables shown above, you could write them to an external file with DISP=MOD using EXECIO commands and maintain a log.

Hope it helps.

It would be better if you could start a separate topic for this instead of posting it under a unrelated topic.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Apr 15, 2011 11:32 am
Reply with quote

This link has an enhanced version of the above program:

billlalonde.tripod.com/rexx/findjsab.txt
Back to top
View user's profile Send private message
tatasteed

New User


Joined: 18 Sep 2007
Posts: 8
Location: Santiago de Chile

PostPosted: Tue Apr 19, 2011 2:45 am
Reply with quote

Your code is amazing and simple.
This is part of the information required.
We also need to have all of the PROC's executed inside a JCL when submitted. I guess this information is also contained in the blocks:
ASCB
ASSB
JSAB
PTR2PSA,
That is something I will have to research, but that you have shed a light on.

If you consider this is worth a separate post, I will open a new thread.

Thanks and regards...
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Apr 19, 2011 12:44 pm
Reply with quote

Glad it was helpful icon_smile.gif
Quote:
have all of the PROC's executed inside a JCL when submitted.

Do you mean to say that you need the list of all the procs that are present inside the JCL thats being run?

Cheers,
Back to top
View user's profile Send private message
tatasteed

New User


Joined: 18 Sep 2007
Posts: 8
Location: Santiago de Chile

PostPosted: Wed Apr 20, 2011 4:34 am
Reply with quote

Yes, Sir!
And I did it!

I wrote a Rexx script activating SDSF which is able to identify jobname and jobid.
With that information reads SDSF and lokks for JESYSMSG.
Then it opens dataset and parses into variables until it finds message IEFC001I.... from then on... queue to write or say command is enough!
All of this in one day!
You certainly shed a light on this as I said.
Thanks!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top