Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4648
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: 10211
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: 1722
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: 10211
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
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us