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

To get the running job name using rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
farnear
Currently Banned

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Mon Mar 02, 2009 6:12 pm
Reply with quote

Hi

Could any one please tell me, whether we can get the running job name using REXX.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Mar 02, 2009 6:14 pm
Reply with quote

Yes and Yes
Back to top
View user's profile Send private message
farnear
Currently Banned

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Mon Mar 02, 2009 6:19 pm
Reply with quote

Could you please let me know how to get it?
Back to top
View user's profile Send private message
farnear
Currently Banned

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Mon Mar 02, 2009 6:34 pm
Reply with quote

expat

could u please tell me how to get the job name ?

Thanks,
~farnear~
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Mar 02, 2009 6:51 pm
Reply with quote

Try this:
Code:
/* REXX */                                                             
/* Get JOBNAME from TCB */                                             
cvt   = storage(10,4)                      /* FLCCVT-PSA data area*/   
tcbp  = storage(d2x(c2d(cvt)),4)           /* CVTTCBP             */   
tcb   = storage(d2x(c2d(tcbp)+4),4)                                     
tiot  = storage(d2x(c2d(tcb)+12),4)        /* TCBTIO              */   
JOBN  = strip(storage(d2x(c2d(tiot)),8))   /* TIOCNJOB            */   
                                                                       
SAY    JOBN                                                             
/* RETURN JOBN */                                                       
EXIT                                                                   


O.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 02, 2009 6:58 pm
Reply with quote

Well, &JOBNAME is one of the available system symbolic values. You can just use the symbol translator program thus:

Code:

/* REXX */
"CALL *(EZACFSM1)"
"EXECIO 1 DISKR SYSOUT"
PARSE PULL JOBNAME .
SAY 'THE JOBNAME IS:'JOBNAME
"EXECIO 0 DISKR SYSOUT (FINIS"
EXIT 0


where the SYSIN DD contains the one record:
//SYSIN DD *
&JOBNAME
/*

and the SYSOUT DD is just a temporary dataset allocated with RECFM=FB and LRECL=80.

Or use the MVSVAR function in a similar manner:
Code:

/* REXX */
jobname = MVSVAR('SYMDEF','JOBNAME')
Say 'The Jobname is:'jobname


or by addressing the control blocks:

Code:

/* REXX */
ascb = C2D(Storage(224,4))
assb = C2D(Storage(D2X(ascb+336),4))
jsab = C2D(Storage(D2X(assb+168),4))
jbnm = Storage(D2X(jsab+28),8)
jbid = Storage(D2X(jsab+20),8)
usid = Storage(D2X(jsab+44),8)
Say 'JOBNAME='jbnm' JOBID='jbid' USERID='usid
Back to top
View user's profile Send private message
farnear
Currently Banned

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Wed Mar 04, 2009 4:20 pm
Reply with quote

Hi superk & ofer71,

Thanks for the worthful info. It is working fine for my requirement.

~FARNEAR~
Back to top
View user's profile Send private message
farnear
Currently Banned

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Wed Mar 04, 2009 5:56 pm
Reply with quote

hi superk,

Could you please explain me the below mentioned commands so that i can understand it for better...

assb = C2D(Storage(D2X(ascb+336),4))

What the following commands represents C2D, Storage & D2X ?

~farnear~
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Mar 04, 2009 5:59 pm
Reply with quote

The answers can be found in the fine manual.

O.
Back to top
View user's profile Send private message
Elixir

Active User


Joined: 08 Feb 2009
Posts: 116
Location: CHENNAI/NEW JERSEY - INDIA/USA

PostPosted: Thu Oct 06, 2011 3:04 am
Reply with quote

Is it possible to get the details of the jobs that have finished executing from the output queue?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Oct 06, 2011 3:10 am
Reply with quote

after 2 years of hanging around You should know that it is better to start a new topic for new questions.

anyway the answer to Your question is YES.
if You dislike YES/NO answers we dislike YES/NO questions
but that' s what You asked for icon_cool.gif

and good manners dictate not to double post the same question icon_evil.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Thu Oct 06, 2011 10:15 am
Reply with quote

Yes - most places I have been use SDSF. Does a marvellous job and has a Rexx interface. All documented.

(Enrico - this is a completely different topic - why has it not been split (yet)!)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Thu Oct 06, 2011 10:19 am
Reply with quote

Quote:
(Enrico - this is a completely different topic - why has it not been split (yet)!)


because I pointed it out as duplicate and I was going to delete it later
Quote:
and good manners dictate not to double post the same question
the TM ( Topic Mangler ) knows because I already replied in another post here
www.ibmmainframes.com/viewtopic.php?t=56367&sid=a85aa4c64ea9f6cf167645229772b410
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top