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

Purge jobs through REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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
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
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: 400
Location: Mumbai

PostPosted: Sat Jan 31, 2009 11:35 am
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jan 31, 2009 6:29 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top