Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To get the running job name using rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: To get the running job name using rexx
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: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 02, 2009 6:14 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Mon Mar 02, 2009 6:51 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Mar 02, 2009 6:58 pm    Post subject: Reply to: To get the running job name using rexx
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    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Wed Mar 04, 2009 5:59 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Thu Oct 06, 2011 3:10 am    Post subject: Reply to: To get the running job name using rexx
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: 1894
Location: UK

PostPosted: Thu Oct 06, 2011 10:15 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Thu Oct 06, 2011 10:19 am    Post subject: Reply to: To get the running job name using rexx
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
http://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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us