View previous topic :: View next topic
|
Author |
Message |
bijal.awhad
New User
Joined: 19 Mar 2008 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
= |
|
Back to top |
|
|
bijal.awhad
New User
Joined: 19 Mar 2008 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Why not try it and see.
At worst, it can only go wrong at again. At best - it works. |
|
Back to top |
|
|
bijal.awhad
New User
Joined: 19 Mar 2008 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Well, try something different, since 'aaaaaaaa' does not work. |
|
Back to top |
|
|
bijal.awhad
New User
Joined: 19 Mar 2008 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
bijal.awhad
New User
Joined: 19 Mar 2008 Posts: 51 Location: Pune
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
It is a good suggestion, but you are right: a little off topic. |
|
Back to top |
|
|
|