View previous topic :: View next topic
|
Author |
Message |
rohitpillai09
New User
Joined: 24 Jun 2009 Posts: 8 Location: Pune
|
|
|
|
Hi All,
I'm trying to execute an ISREDIT macro embedded in REXX.
address ispexec
trace i?
"ISREDIT MACRO"
"ISREDIT CAPS OFF"
"ISREDIT (LINE1) = LINENUM .ZCSR" /* Cursor Position/Current Line */
"ISREDIT (END1) = LINENUM .ZLAST" /* Last line in the file */
"ISREDIT (ST1) = LINENUM .ZFIRST" /* First line in the file */
cur_line = LINE1
st_line = 0
end_line = 0
The TRACE output that I receive is RC = 20. The TRACE output is as below:
24 *-* /* This is to Identify a Macro.
25 *-* "ISREDIT MACRO"
>L> "ISREDIT MACRO"
+++ RC(20) +++
26 *-* "ISREDIT CAPS OFF"
>L> "ISREDIT CAPS OFF"
+++ RC(20) +++
The cur_line should contain the current line position but the ISR macro is not able to pick up the line number. Please suggest and let me know for more information. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Is the macro resident within a SYSPROC or SYSEXEC concatenated library |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
why do you have: address ispexec ? |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
Show the whole exec/macro, including the 24 lines before the "ISREDIT MACRO" statement! |
|
Back to top |
|
|
rohitpillai09
New User
Joined: 24 Jun 2009 Posts: 8 Location: Pune
|
|
|
|
Hi All,
The REXX code starts with Address ISPEXEC. The lines before that are comment lines, thats why its showing as Line 24.
The macro is present in my personal PDS. ISPEXEC is used to indicate the start of macro.
If it is allowed I can attach the whole source code. I think there is some problem with ISREDIT command as it is not able to read the line number. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Is your personal PDS concatenated into SYSEXEC or SYSPROC, as asked previously.
Quote: |
ISPEXEC is used to indicate the start of macro. |
Why on earth do you think that.
Quote: |
I think there is some problem with ISREDIT command as it is not able to read the line number. |
I on the other hand think that your macro is not in the correct concatenation. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Code: |
25 *-* "ISREDIT MACRO"
>L> "ISREDIT MACRO"
+++ RC(20) +++ |
I think this means you are not inside of the editor. An editor macro has to run inside of the editor. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I was thinking the same thing, although I can't imagine how you'd have your cursor placed on a line if you weren't in Edit/View. |
|
Back to top |
|
|
rohitpillai09
New User
Joined: 24 Jun 2009 Posts: 8 Location: Pune
|
|
|
|
Hi All,
The REXX macro will comment out the complete step in a JCL or PROC. When we place the cursor on the linenum on extreme left and give command "tso exec <pdsname>(CSTEP)", it keeps on scanning the lines above to find the EXEC command. Once it finds it, it will scan downwards to find the next EXEC command. All the lines between these two commands will be commented out.
Now in the macro IRSEDIT is used to determine the line number. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
rohitpillai09 wrote: |
we place the cursor on the linenum on extreme left and give command "tso exec <pdsname>(CSTEP) ..." |
Is this how you are trying to start an editor macro called CSTEP? Edit macros are editor commands, not TSO commands. Just type CSTEP |
|
Back to top |
|
|
rohitpillai09
New User
Joined: 24 Jun 2009 Posts: 8 Location: Pune
|
|
|
|
Yes, I'm trying to invoke the editor macro by giving tso exec command because when i give only CSTEp on command line, it throws me an error " Command Not Found". Please find the attached source code for the same.
Guys I'm new to mainframe so please understand the concern and repeated queries. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
You DO NOT TSO EXEC a macro.
Hence my previous two posts asking, and not being answered, is your PDS concatenated into SYSEXEC or SYSPROC.
If the answer is NO - then go away and read the ALTLIB statement.
Then after using it you can type the name of your macro on the command line, put the cursor where you want and hit enter and perhaps then you may see the desired results.
** run the ALTLIB in the ISPF session that you wish to perform your macro work **
We do not sit here asking questions about what you have and have not done because we have nothing better to do, it is because we need more information to try and resolve your problem. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Please DO NOT post attachments as I for one can not open them. And the less people that can open them - the less people that can help you. |
|
Back to top |
|
|
rohitpillai09
New User
Joined: 24 Jun 2009 Posts: 8 Location: Pune
|
|
|
|
How do I concatenate my PDS into SYSEXEC or SYSPROC and after that execute the macro? |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
Commenting out means that if you remove the comment, the original code will work again as it did before. Your code adds '//*~' to a line, which does wonders for in-stream data that extends to column 80, for parameters that extend past column 71.
The only way to bullet-proof comment out sections of JCL so that they can be restored later, is to
- add a dummy IEFBR14 step as the first step of the JOB, so that there is a return code to allow you to comment out the first step
- add an impossible to match IF-ENDIF condition around the steps to comment out, i.e.
Code: |
//IFSKIP IF RC < 4 & RC > 8 THEN
//*
- - - - - - - - - - - - -
//SA010 EXEC PGM=WHATEVER
- - - - - - - - - - - - -
//*
//IFSKIPE ENDIF |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I have given you the answer above
and reiterate it below
If the answer is NO - then go away and read the ALTLIB statement.
|
|
Back to top |
|
|
rohitpillai09
New User
Joined: 24 Jun 2009 Posts: 8 Location: Pune
|
|
|
|
I dont see how IEFBR14 and an impossible IF-ENDIF condition would help. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
That's because you're obviously not smart enough to realize that I am commenting on your hopelessly crappy macro. Adding "//*~" comments to lines will irreparably damage JCL statements extending past column 68 and in-stream data that extends past column 76. |
|
Back to top |
|
|
rohitpillai09
New User
Joined: 24 Jun 2009 Posts: 8 Location: Pune
|
|
|
|
So if i'm not smart enough, can you help me as to how should I go about achieving my goal of making a tool that comments a complete Step of JCL/PROC. What should be the logic thatI must look at? |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
I told you, add a dummy IEFBR14 to get a returncode and enclose your to-be-commented-out step with an IF-ENDIF statement that can never evaluate to true. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
prino wrote: |
Code: |
//IFSKIP IF RC < 4 & RC > 8 THEN
//*
- - - - - - - - - - - - -
//SA010 EXEC PGM=WHATEVER
- - - - - - - - - - - - -
//*
//IFSKIPE ENDIF |
|
I prefer
Code: |
//IFSKIP IF RC < 0 THEN
//*
- - - - - - - - - -
//SA010 EXEC PGM=WHATEVER
- - - - - - - - - -
//*
//IFSKIPE ENDIF |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
An additional suggestion is to add an indicator on the lines that you added, so that you can remove easily later.
Code: |
//IFSKIP IF RC < 0 THEN /*CSTEP'ed by Pedro*/
//*
- - - - - - - - - -
//SA010 EXEC PGM=WHATEVER
- - - - - - - - - -
//*
//IFSKIPE ENDIF /*CSTEP'ed by Pedro*/
|
If there is room, perhaps add a timestamp too. |
|
Back to top |
|
|
rohitpillai09
New User
Joined: 24 Jun 2009 Posts: 8 Location: Pune
|
|
|
|
Can someone suggest me some other way by which I can achieve my goal of commenting an entire STEP in JCL, preferably without REXX. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
If it really is that difficult for you, here's a code that will comment out a section of code, or even a single line of code.
Use NN at the first and last line of the step that you want to comment out, or a single N to comment out a single line.
Now, remember what I said about ALTLIB and correct concatenation in my previous replies to your post. There are a lot of posts about this on the forum. Also access to all the manuals that you will need can be found in the "STICKY" subjects in the CLIST/REXX forum.
So once you have sorted that out, shouldn't really take you more than 15 minutes, you type whatever member name you have given the code in the PDS on the command line, and place the N or NN/NN where you want and then press enter.
Code: |
"ISREDIT MACRO NOPROCESS"
"ISPEXEC CONTROL ERRORS RETURN"
"ISREDIT PROCESS RANGE N"
"ISREDIT (FRL) = "LINENUM .ZFRANGE
"ISREDIT (TOL) = "LINENUM .ZLRANGE
"ISREDIT LABEL "FRL" = .A"
"ISREDIT LABEL "TOL" = .B"
"ISREDIT C '//' '//*~' 1 ALL .A .B "
"ISREDIT RESET LABEL"
EXIT (1) |
However, I do rather agree with prino about the correct way to do this, but maybe that's something you can work on once you master the basics of ISPF dialogues. |
|
Back to top |
|
|
|