View previous topic :: View next topic
|
Author |
Message |
nbdtrjk1
New User
Joined: 19 Jan 2007 Posts: 3 Location: India
|
|
|
|
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 |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
nbdtrjk1
New User
Joined: 19 Jan 2007 Posts: 3 Location: India
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Take a look at the PROCESS command.
O. |
|
Back to top |
|
|
nbdtrjk1
New User
Joined: 19 Jan 2007 Posts: 3 Location: India
|
|
|
|
What is that PROCESS command? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
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 |
|
|
|