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

Change a string using macro & submit via a batch job - h


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Fri May 05, 2006 2:32 pm
Reply with quote

I am just new with REXX programming and would want to do this as I am always getting a RC(-3)

Thanks

Objective:
From an input dataset, i want to change all READ,WRITE,ALLOC into R,W,A and del all EXEC

REXX
----------------------------
Code:

/**REXX**************************************
********************************************/
 PARSE ARG DSNAME MACRO1                     
 ADDRESS ISPEXEC                             
 "EDIT DATASET('"DSNAME"') MACRO("MACRO1")" 
 EXIT                                       


MACRO - MACRO01
-----------------------------------
Code:

/* REXX */                   
ISREDIT MACRO               
ISREDIT CHANGE READ R ALL   
ISREDIT CHANGE WRITE W ALL   
ISREDIT CHANGE ALLOC A ALL   
ISREDIT CHANGE EXEC(L) '' ALL
ISREDIT CHANGE EXEC(A) '' ALL
END                         


JCL
-------------------------------------
Code:

//REXPROC1 PROC                                         
//STEP010  EXEC PGM=IKJEFT01,DYNAMNBR=20,               
//         PARM='%EDITREXX &ARG01 &ARG02'               
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYSTSPRT DD SYSOUT=(G,,JOHN)                           
//SYSTSIN  DD DUMMY                                     
//SYSPROC  DD DSN=TSGP.PDS.JASON.WORK.REXX,DISP=SHR     
//         PEND                                         
//STEP01   EXEC REXPROC1,ARG01=TSGS.TEST.IDS,ARG02=MACRO01
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri May 05, 2006 6:25 pm
Reply with quote

OK.

#1.
Code:

/* REXX */                   
ISREDIT MACRO               
ISREDIT CHANGE READ R ALL   
ISREDIT CHANGE WRITE W ALL   
ISREDIT CHANGE ALLOC A ALL   
ISREDIT CHANGE EXEC(L) '' ALL
ISREDIT CHANGE EXEC(A) '' ALL
END                         

This is NOT valid REXX code, and your ISPF Editor indicates such. ISREDIT and END are not valid REXX constructs. It is, however, valid CLIST code (minus the /* REXX */ statement, of course).

#2.
In your JCL, I don't see any ISPSTART command to invoke ISPF or any DD allocations for the requisite ISPF libraries (ISPLLIB, ISPPLIB, ISPSLIB, ISPMLIB, ISPPROF, ISPTABL, ISPTLIB, ISPLOG, ISPLIST).

For more details on the ISPSTART command, see here in the z/OS V1R7.0 ISPF Dialog Developer's Guide.
Back to top
View user's profile Send private message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Fri May 05, 2006 8:25 pm
Reply with quote

if I am to invoke this as a CLIST, do i need to have ISPSTART command in my jcl?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri May 05, 2006 8:39 pm
Reply with quote

You only need to invoke ISPSTART if you want to use ISPF services.
Back to top
View user's profile Send private message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Sun May 07, 2006 8:08 pm
Reply with quote

Where do i put ISPSTART in my jcl? do i need to also to do DD allocations for the requisite ISPF libraries? or can i just use ISPSTART?
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 May 08, 2006 3:04 am
Reply with quote

here is a great example of an IPSF batch job in the z/OS V1R7.0 ISPF Dialog Developer's Guide.
Back to top
View user's profile Send private message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Mon May 08, 2006 8:59 am
Reply with quote

thank you very much! icon_smile.gif
Back to top
View user's profile Send private message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Mon May 08, 2006 12:40 pm
Reply with quote

Can someone please help with this... getting a MAXCC=12
Also, I tried searching for my id (using 3.4) and it seems only 'T62811.ISPF.ISPPROF' is only available... so i tried using DUMMY/SYSOUT=* however, job failed.
Code:

//TSOBTCH1  EXEC PGM=IKJEFT01                   
//ISPPROF   DD DSN=TS62811.ISPF.ISPPROF,DISP=SHR
//ISPPLIB   DD DSN=ISP.SISPPENU,DISP=SHR       
//ISPMLIB   DD DSN=ISP.SISPMENU,DISP=SHR       
//ISPSLIB   DD DSN=ISP.SISPSENU,DISP=SHR       
//          DD DSN=ISP.SISPSLIB,DISP=SHR       
//ISPTLIB   DD DSN=TS62811.ISPF.TABLES,DISP=SHR
//ISPTLIB   DD DSN=ISP.SISPTENU,DISP=SHR       
//               DD DSN=ISP.SISPTLIB,DISP=SHR       
//ISPTABL   DD DSN=TS62811.ISPF.TABLES,DISP=SHR
//ISPLOG    DD DSN=TS62811.ISPF.LOG,DISP=SHR   
//ISPLLIB   DD DSN=TS62811.ISPF.LOAD,DISP=SHR 
//SYSEXEC   DD DSN=ISP.SISPEXEC,DISP=SHR           
//SYSPROC   DD DSN=TSGP.PDS.JASON.WORK.REXX,DISP=SHR
//SYSPRINT  DD SYSOUT=*                             
//SYSOUT    DD SYSOUT=*                             
//SYSTSPRT  DD SYSOUT=*                             
//SYSTSIN   DD *                                   
  PROFILE PREFIX(TS62811)                           
  ISPSTART CMD(%EDITREXX TSGS.TEST.IDS MACRO1)     
/*                                                 


TSGS.TEST.IDS ---> Dataset i want to edit
MACRO1 ----> Macro that will edit the dataset
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 May 08, 2006 5:44 pm
Reply with quote

Please post the error message(s).
Back to top
View user's profile Send private message
crazyf1

New User


Joined: 05 May 2006
Posts: 26

PostPosted: Tue May 09, 2006 10:30 am
Reply with quote

I am getting a MAXCC=12 abend 0C4 using this JCL. i really can't find any library allocated to my ispf.
Using 3.4 and searching for my id as HLQ

    TS62811.CPPTEMP1.SCPPWORK
    TS62811.CPPTEMP2.SCPPWORK
    TS62811.CPPTEMP3.SCPPWORK
    TS62811.HCD.MSGLOG
    TS62811.HCD.TERM
    TS62811.HCD.TRACE
    TS62811.ISPF.ISPPROF
    TS62811.ISPF.ISPPROF.CPUG
    TS62811.LOG.MISC
    TS62811.SPFLOG1.LIST
    TS62811.SPFTEMP0.CNTL
    TS62811.SRCHFOR.LIST
    TS62811.SUPERC.LIST


JCL <-- substituted all files with SYSOUT=*
---------------------------------------------------------------
Code:

//TSOBTCH1  EXEC PGM=IKJEFT01                   
//ISPPROF   DD SYSOUT=*
//ISPPLIB   DD DSN=ISP.SISPPENU,DISP=SHR       
//ISPMLIB   DD DSN=ISP.SISPMENU,DISP=SHR       
//ISPSLIB   DD DSN=ISP.SISPSENU,DISP=SHR       
//*          DD DSN=ISP.SISPSLIB,DISP=SHR       
//ISPTLIB   DD SYSOUT=*
//ISPTLIB   DD DSN=ISP.SISPTENU,DISP=SHR       
//               DD DSN=ISP.SISPTLIB,DISP=SHR       
//ISPTABL   DD SYSOUT=*
//ISPLOG    DD SYSOUT=*   
//ISPLLIB   DD SYSOUT=* 
//SYSEXEC   DD DSN=ISP.SISPEXEC,DISP=SHR           
//SYSPROC   DD DSN=TSGP.PDS.JASON.WORK.REXX,DISP=SHR
//SYSPRINT  DD SYSOUT=*                             
//SYSOUT    DD SYSOUT=*                             
//SYSTSPRT  DD SYSOUT=*                             
//SYSTSIN   DD *                                   
  PROFILE PREFIX(TS62811)                           
  ISPSTART CMD(%EDITREXX TSGS.TEST.IDS MACRO1)     
/*                               
[/list]
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
Search our Forums:

Back to Top