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

RC =20 in ISREDIT macro in REXX


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

New User


Joined: 24 Jun 2009
Posts: 8
Location: Pune

PostPosted: Mon Aug 24, 2009 4:59 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Mon Aug 24, 2009 5:08 pm
Reply with quote

Is the macro resident within a SYSPROC or SYSEXEC concatenated library
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 24, 2009 5:23 pm
Reply with quote

why do you have: address ispexec ?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Mon Aug 24, 2009 5:26 pm
Reply with quote

Show the whole exec/macro, including the 24 lines before the "ISREDIT MACRO" statement!
Back to top
View user's profile Send private message
rohitpillai09

New User


Joined: 24 Jun 2009
Posts: 8
Location: Pune

PostPosted: Mon Aug 24, 2009 6:11 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Mon Aug 24, 2009 6:15 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Mon Aug 24, 2009 9:14 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Aug 24, 2009 11:23 pm
Reply with quote

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
View user's profile Send private message
rohitpillai09

New User


Joined: 24 Jun 2009
Posts: 8
Location: Pune

PostPosted: Tue Aug 25, 2009 11:48 am
Reply with quote

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
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Tue Aug 25, 2009 11:54 am
Reply with quote

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
View user's profile Send private message
rohitpillai09

New User


Joined: 24 Jun 2009
Posts: 8
Location: Pune

PostPosted: Tue Aug 25, 2009 12:01 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Aug 25, 2009 12:04 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Aug 25, 2009 12:08 pm
Reply with quote

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
View user's profile Send private message
rohitpillai09

New User


Joined: 24 Jun 2009
Posts: 8
Location: Pune

PostPosted: Tue Aug 25, 2009 12:17 pm
Reply with quote

How do I concatenate my PDS into SYSEXEC or SYSPROC and after that execute the macro?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Tue Aug 25, 2009 12:28 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Aug 25, 2009 12:28 pm
Reply with quote

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
View user's profile Send private message
rohitpillai09

New User


Joined: 24 Jun 2009
Posts: 8
Location: Pune

PostPosted: Tue Aug 25, 2009 1:05 pm
Reply with quote

I dont see how IEFBR14 and an impossible IF-ENDIF condition would help.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Tue Aug 25, 2009 1:31 pm
Reply with quote

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
View user's profile Send private message
rohitpillai09

New User


Joined: 24 Jun 2009
Posts: 8
Location: Pune

PostPosted: Tue Aug 25, 2009 2:01 pm
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Tue Aug 25, 2009 3:28 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Tue Aug 25, 2009 9:51 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Wed Aug 26, 2009 12:59 am
Reply with quote

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
View user's profile Send private message
rohitpillai09

New User


Joined: 24 Jun 2009
Posts: 8
Location: Pune

PostPosted: Fri Aug 28, 2009 12:13 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Aug 28, 2009 12:20 pm
Reply with quote

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
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 Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Starting a PROC with parameters from ... CLIST & REXX 6
No new posts Help needed in automation cics transa... CLIST & REXX 1
Search our Forums:

Back to Top