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

Error while executing the rexx code


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Mon Oct 26, 2009 4:12 pm
Reply with quote

Hi,

I am new to the rexx & was working on the code given below.


Code:
***************************** Top of Data ******************************
/*REXX TO DISPLAY PARANAME*/                                 
/* DISPLAYS THE PARAGRAPH NAMES IN A COBOL PGM */                       
/* IT WORKS IF THE EDIT MODE IS NUM ON STD OR NUM OFF             */   
/*TRACE ?I*/                                                           
ISREDIT MACRO                                                           
ADDRESS ISREDIT "F 'PROCEDURE DIVISION' 8 FIRST"                       
ADDRESS ISREDIT "F  P'-' 8"                                             
DO UNTIL RC > 0                                                         
   ADDRESS ISREDIT  "(THELINE) = LINE .ZCSR"                           
   IF  POS("EXIT",THELINE) = 0 ,                                       
   &   POS("*",THELINE) = 0 ,                                           
   &   POS("-INC",THELINE) = 0 ,                                       
   &   POS("COPY",THELINE) = 0                                         
   THEN                                                                 
     DO                                                                 
       PARSE VAR THELINE NUM  " " LINE1 "." LINE2                       
       LINE3 = STRIP(LINE1,'L'," ")                                     
/*     LINE3 = "FJGNL - "LINE3           */                             
       ADDRESS ISREDIT LINE_AFTER  .ZCSR "DISPLAY ('"LINE3"')"         
     END                                                               
   ADDRESS ISREDIT  "F P'¬' 8"                                         
END                                                                     
EXIT 1                                                                 
**************************** Bottom of Data ****************************



The above code is for adding Display's statement after every paragraph in the cobol program. At our place we use displays for debugging the program & hence need to put displays manually.

While executing the above code i got error as below


Code:
******************************************************************************
*                                                                            *
* Command in error . : LINE_AFTER .ZCSR DISPLAY ('0000-RECEIVE-ACQ-RECORD')  *
*                                                                            *
* Syntax is incorrect                                                        *
* Assignment stmt must use syntax "ISREDIT LINE_AFT lptr = value".           *
*                                                                            *
*   Error message ID . : ISRE142                                             *
*                                                                            *
*   Last return code . : 20                                                  *
*                                                                            *
*   Macro executing  . : TESTDISP                                            *
*                                                                            *
* Press ENTER key to terminate the macro.                                    *
*                                                                            *
*                                                                            *
*                                                                            *
******************************************************************************


In the above error ''0000-RECEIVE-ACQ-RECORD'' is the first paragraph in my cobol program.

I have partially understood the code after going through the manuals & got this.
ISRE142Syntax is incorrect - Assignment stmt must use syntax "ISREDIT aaaaaaaa lptr = value".
Explanation:This assignment statement requires a line pointer argument.

User Response: Correct the assignment statement
But still not sure about the corrective action. Can someone help me to correct the error & code.

The para names we use at our place are like


Code:
*****************************
0000-FIRST-PARA.       
*****************************


Code:
*****************************
1000-SECOND-PARA.       
*****************************



Please let me know if anyother info is needed.

Thanks
BIjal[/code]
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Oct 26, 2009 4:17 pm
Reply with quote

=
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Mon Oct 26, 2009 4:34 pm
Reply with quote

dbzTHEdinosauer wrote:
=


Hi Dick,

Did you mean putting '=' between .ZCSR & DISPLAY as given below
Code:
ADDRESS ISREDIT LINE_AFTER  .ZCSR  = "DISPLAY ('"LINE3"')"


Correct me if i am wrong.

Regards
Bijal
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Oct 26, 2009 5:08 pm
Reply with quote

Why not try it and see.

At worst, it can only go wrong at again. At best - it works.
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Mon Oct 26, 2009 5:12 pm
Reply with quote

expat wrote:
Why not try it and see.

At worst, it can only go wrong at again. At best - it works.



I have tried it. It says

ISRE454Command name is invalid - The name 'aaaaaaaa' is invalid. Not an edit command / macro name.
Explanation:
The command aaaaaaaa is not valid for a macro name. Valid macro names have 8 characters or fewer, start with an alphabetic or national character, and may have alphabetic characters, national characters, or numeric digits after the first character. In addition, program macros may be preceded by an exclamation point.

User Response:
Retype the command using a valid name for an edit command.

Regards
Bijal
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Oct 26, 2009 5:22 pm
Reply with quote

Well, try something different, since 'aaaaaaaa' does not work.
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Mon Oct 26, 2009 5:54 pm
Reply with quote

dbzTHEdinosauer wrote:
Well, try something different, since 'aaaaaaaa' does not work.



Hi Dick,

The name 'aaaaaaaa' is invalid. Not an edit command / macro name. 'aaaaaaaa' is reffering to what actually in the below code

Code:
ADDRESS ISREDIT LINE_AFTER  .ZCSR "DISPLAY ('"LINE3"')"         


Can you suggest any alternatives to add a Display statement after every paragraph in the prograam.

For example

Code:
*****************************
0000-FIRST-PARA.       
*****************************
DISPLAY '0000-FIRST-PARA'


Code:
*****************************
1000-SECOND-PARA.       
*****************************
DISPLAY '1000-SECOND-PARA'
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Oct 26, 2009 7:42 pm
Reply with quote

Compare the suggested format:
Code:
"ISREDIT aaaaaaaa lptr = value".

to your line:
Code:
 ISREDIT LINE_AFTER  .ZCSR "DISPLAY ('"LINE3"')"


Also, it was suggested that you use an equal sign. It is not clear that you tried it. Please confirm. And show us your latest statement.
Back to top
View user's profile Send private message
bijal.awhad

New User


Joined: 19 Mar 2008
Posts: 51
Location: Pune

PostPosted: Tue Oct 27, 2009 11:50 am
Reply with quote

Pedro wrote:
Also, it was suggested that you use an equal sign. It is not clear that you tried it. Please confirm. And show us your latest statement.


Hi
See below
Code:
***************************** Top of Data ******************************
ISREDIT MACRO                                                           
ADDRESS ISREDIT "F 'PROCEDURE DIVISION' 8 FIRST"                       
ADDRESS ISREDIT "F  P'-' 8"                                             
DO UNTIL RC > 0                                                         
   ADDRESS ISREDIT  "(THELINE) = LINE .ZCSR"                           
   IF  POS("EXIT",THELINE) = 0 ,                                       
   &   POS("*",THELINE) = 0 ,                                           
   &   POS("-INC",THELINE) = 0 ,                                       
   &   POS("COPY",THELINE) = 0                                         
   THEN                                                                 
     DO                                                                 
       PARSE VAR THELINE NUM  " " LINE1 "." LINE2                       
       LINE3 = STRIP(LINE1,'L'," ")                                     
/*     LINE3 = "FJGNL - "LINE3           */                             
       ADDRESS ISREDIT LINE_AFTER .ZCSR = "DISPLAY ('"LINE3"')"         
     END                                                               
   ADDRESS ISREDIT  "F P'¬' 8"                                         
END                                                                     
EXIT 1                                                                 
**************************** Bottom of Data ****************************


I tried using '=' sign but getting error as below

Code:
******************************************************************************
*                                                                            *
* Command in error . : 0                                                     *
*                                                                            *
* Command name is invalid                                                    *
* The name '0' is invalid. Not an edit command / macro name.                 *
*                                                                            *
*   Error message ID . : ISRE454                                             *
*                                                                            *
*   Last return code . : 20                                                  *
*                                                                            *
*   Macro executing  . : TESTDISP                                            *
*                                                                            *
* Press ENTER key to terminate the macro.                                    *
*                                                                            *
*                                                                            *
*                                                                            *
******************************************************************************
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Oct 27, 2009 7:20 pm
Reply with quote

Lets do this again:


Compare the suggested format:
Code:

"ISREDIT aaaaaaaa lptr = value"


to your line:
Code:

 ISREDIT LINE_AFTER  .ZCSR = "DISPLAY ('"LINE3"')"


Hint: in your other ISREDIT lines, you have fully enclosed in quotes, but in this line you do not.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Tue Oct 27, 2009 9:03 pm
Reply with quote

In future, I would suggest that you use the other syntax for ISREDIT commands that use variables.

instead of
Code:
address isredit "LINE_AFTER .ZCSR = 'some value'"

use
Code:
xxxx = 'some value'
address isredit "LINE_AFTER .ZCSR = (xxxx)"

This will avoid substitutions that the editor might do.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Oct 27, 2009 9:56 pm
Reply with quote

Quote:
This will avoid substitutions that the editor might do.

Just to be clear, it is the rexx processor that is resolving your statement before handing it off to the editor command processor.

By not putting the equal sign in quotes, you are asking rexx to compare two strings.
Code:
something = something_else

The statement is false, so the result is a zero.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Tue Oct 27, 2009 10:48 pm
Reply with quote

That is true, but I was referring to substitutions that ISPF would do. When parsing the statement to execute (after Rexx hands the command off to ISPF), ISPF will substitute things starting with ampersand. For example:
Code:
"line_after .zcsr = '&ztime'"
will add the time, whereas
Code:
 var='&ztime'               
 "line_after .zcsr = (var)"
will add the string "&ztime". This often causes problems in macros that deal with JCL that contains temporary data set names.

This isn't really a Rexx issue, so it is a little off topic here. I mention it only because it is a hard one to debug if you don't know about it and it comes up often.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Oct 27, 2009 11:12 pm
Reply with quote

It is a good suggestion, but you are right: a little off topic.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts Executing DB2 SQL store procedure via... DB2 0
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts Help on IMS -API URL migrating from P... IMS DB/DC 1
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top