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
 

 

Purge jobs through REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Sat Jan 31, 2009 3:39 am    Post subject: Purge jobs through REXX
Reply with quote

Hi Friends,

I need to purge the job in SDSF.

When i try to use the below command, i could not able to purge

ADDRESS TSO "CANCEL "JNAME.I"("JOBID.I") PURGE"

Error message - "JOBNAME SHOULD BE USERID PLUS ATLEAST 1 CHARACTER".

Then i tried the below code to get the job name and Purge

/* REXX */
TCB = PTR(540)
TIOT= PTR(TCB+12)
JobNAM= STG(TIOT,8)
StepNAM= STG(TIOT+8,8)
ProcNAM = STG(TIOT+16,8)
JSCB= PTR(TCB+180)
ProgNAM= STG(JSCB+360,8)
SSIB= PTR(JSCB+316)
JobNUM= STG(SSIB+12,8)

SAY 'JOB NAME:' JobNAM
SAY 'PROC STEP NAME:' ProcNAM
SAY 'STEP NAME :' StepNAM
SAY 'PROGRAM NAME:' ProgNAM
SAY 'JOB NUMBER:' JobNUM
EXIT(0)
PTR: RETURN C2D(STORAGE(D2X(ARG(1)),4))
STG: RETURN STORAGE(D2X(ARG(1)),ARG(2))

Still i could not able purge. the command always expects the job name should be USERID + 1 character.

I tried the below code, but still i could not able to execute.

rc=isfcalls(”ON”)
Address SDSF “ISFEXEC ST”
do ix=1 to JNAME.0
if pos(“KEN”,JNAME.ix) = 1 then
Address SDSF “ISFACT ST TOKEN(‘”TOKEN.ix”’) PARM(NP P)”
rc=isfcalls(“OFF”)

i am getting an error message like
"END OF FILE ON CLIST INPUT OCCURRED BEFORE ALL DO STMTS WERE CLOSED"

Let me know whether i am following the right process.

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

Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sat Jan 31, 2009 10:17 am    Post subject:
Reply with quote

Assuming you have the authority to purge a job, why can't you (C)ancel it or (P)urge it as a line command on the SDSF screen instead of submitting a REXX program to do it?
Back to top
View user's profile Send private message
DB2 Guy

New User


Joined: 28 Oct 2008
Posts: 98
Location: Cubicle

PostPosted: Sat Jan 31, 2009 11:27 am    Post subject:
Reply with quote

Or may be block purge (//P..//P) if there are multiple jobs to be purged..
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Sat Jan 31, 2009 11:35 am    Post subject: Reply to: Purge jobs through REXX
Reply with quote

also notice that your message says that it is interpreting your code as a CLIST, not as Rexx. add the /* Rexx */ comment as the 1st line.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8123
Location: East Dubuque, Illinois, USA

PostPosted: Sat Jan 31, 2009 6:29 pm    Post subject:
Reply with quote

From the TSO Command Reference manual:
Quote:
1.11.2 CANCEL Command Operands


(jobname (jobid))
specifies the names of the jobs that you want to cancel. The job names must consist of your user identification plus 1 to 8 alphanumeric characters. However, if your installation has replaced the default IBM-supplied CANCEL exit, you may be allowed to specify different job names.
So it sounds like your site is using the IBM-supplied CANCEL exit and you may only be able to use REXX to cancel jobs that have names starting with your userid. I suggest you contact your site system support people and find out if this is the case.
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 Iterative use of a REXX script causin... bryonyh CLIST & REXX 2 Fri Jul 28, 2017 12:52 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm


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