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

Edit macro to comment the selected JCL statements


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

New User


Joined: 19 Jan 2007
Posts: 3
Location: India

PostPosted: Fri Feb 23, 2007 11:22 am
Reply with quote

I want an edit macro to comment the selected JCL statements. Just take a look up below ex:

Input
Code:

//SYSPRINT DD  SYSOUT=*                             
//SYSUT1   DD  UNIT=SYSDA,SPACE=(1024,(50,20))     
//SYSLIB   DD  DSN=DBITS.DBA.PGMLIB,DISP=SHR       
//         DD  DSN=SYS1.SCEELKED,DISP=SHR           
//         DD  DSN=SYS1.TCPIP.SEZATCP,DISP=SHR     
//SYSLMOD  DD  DSN=&LOADLIB(&MEMBER),DISP=SHR       
//SYSLIN   DD  DSN=&&OBJECT,DISP=(OLD,DELETE)       
//         DD  DDNAME=SYSIN                         
//SYSIN    DD  DUMMY                               


Output:
Code:

//*SYSPRINT DD  SYSOUT=*                             
//*SYSUT1   DD  UNIT=SYSDA,SPACE=(1024,(50,20))     
//SYSLIB   DD  DSN=DBITS.DBA.PGMLIB,DISP=SHR       
//         DD  DSN=SYS1.SCEELKED,DISP=SHR           
//         DD  DSN=SYS1.TCPIP.SEZATCP,DISP=SHR     
//*SYSLMOD  DD  DSN=&LOADLIB(&MEMBER),DISP=SHR       
//SYSLIN   DD  DSN=&&OBJECT,DISP=(OLD,DELETE)       
//         DD  DDNAME=SYSIN                         
//*SYSIN    DD  DUMMY     
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Fri Feb 23, 2007 2:43 pm
Reply with quote

Hi !

I dont really know what you want to achieve with that, but if the words you want to change are allways the same, a EDIT-MACRO will do:

ISREDIT MACRO
ISREDIT C '//BlaBlaBla' '//* BlaBlaBla' all
ISREDIT C'//...next one & so on
ISREDIT RESET

Regards, UmeySan
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 Feb 23, 2007 2:52 pm
Reply with quote

I believe what is going to have to be done is that you'll have to enter the macro's name on the command line, move the cursor down to the line you want to comment, and the press ENTER to comment the line. Repeat the process for the next line, and so on.
Back to top
View user's profile Send private message
nbdtrjk1

New User


Joined: 19 Jan 2007
Posts: 3
Location: India

PostPosted: Fri Feb 23, 2007 3:30 pm
Reply with quote

yes sir, I am working in Conversion project. I want to change lot jcls statements. that why i am looking for this tool.


My exact requirement is i'll place 'S' in the line command in the lot places in that member, after that i want to execute rexx macro. The output should comment all the seleted satements
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Fri Feb 23, 2007 3:39 pm
Reply with quote

Take a look at the PROCESS command.

O.
Back to top
View user's profile Send private message
nbdtrjk1

New User


Joined: 19 Jan 2007
Posts: 3
Location: India

PostPosted: Fri Feb 23, 2007 5:17 pm
Reply with quote

What is that PROCESS command?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Feb 23, 2007 10:04 pm
Reply with quote

Hello,

Do you have access to the File-Aid product?

File-Aid has an option that lets you change a value across an entire pds - quite handy for JCL and program code.

If you search the forums, i believe a solution like what you want was posted in the last few weks - i just don't remember what it was called icon_confused.gif
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Sat Feb 24, 2007 1:01 am
Reply with quote

nbdtrjk1, my apologies. I guess you can tell I don't get to write EDIT macros much. I had no idea that there was the PROCESS command, as ofer71 mentioned, that appears to do exactly what you asked for. Guess there's always the opportunity to learm something new. I'm going to have to play with it a bit, see what it can do.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sat Feb 24, 2007 8:08 pm
Reply with quote

I've used the PROCESS command to write an Edit-Macro which can comment almost any type of source code (JCL, COBOL, Assembler, panels, REXX, CLIST, SQL etc.). It starts with "MACRO NOPROCESS", then looks for CC CC or MM MM.

O.
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 89
Location: Stockholm, Sweden

PostPosted: Sun Feb 25, 2007 11:25 pm
Reply with quote

This is a cut-down version of a macro that copes with many language 'types' (similar to the one mentioned above)...
Code:

/*REXX(CM)*/ TRACE "N"                                                 
xx = MSG("OFF")                                                         
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"                                 
ADDRESS ISREDIT                                                         
"MACRO (PARMS,DROP) NOPROCESS"                                         
"PROCESS RANGE S C "                                                   
range = SUBWORD(".ZF .ZL .ZFRANGE .ZLRANGE",1+(RC=0)*2,2)               
parms = STRIP(TRANSLATE(parms))                                         
PARSE VALUE 0 ABBREV("ON",parms,0) ABBREV("OFF",parms,2),               
            (ABBREV("ON",parms,0)|ABBREV("OFF",parms,2)),               
      WITH  RC on off valid                                             
IF( valid=0 )THEN                                                       
   CALL ABEXIT 1,"INVALID option",,                                     
                 "Option:" parms,                                       
                 "is invalid. CM allows option 'ON' or 'OFF' only"     
IF( on )THEN DO                                                         
   "X '//*' 1 ALL" range                                               
   "C '//' '//*' 1 ALL NX" range                                       
   "F P'='  1 ALL" range                                               
   END                                                                 
ELSE DO WHILE( RC=0 )                                                   
   "C '//*' '//' 1 ALL" range                                           
   END                                                                 
"SEEK P'=' 1 FIRST "                                                   
EXIT 1                                                                 
/*-abnormal exit-----------------------------------------------------*/
ABEXIT:                                                                 
PARSE ARG cc,zerrsm,zerrlm                                             
PARSE VALUE "YES NONE" WITH zerralrm zerrhm                             
ADDRESS ISPEXEC "SETMSG MSG(ISRZ002) "   
EXIT cc                                 
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 Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts Need help to resolve a hard edit COBOL Programming 8
Search our Forums:

Back to Top