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

Error in sample program


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Jul 16, 2009 6:03 pm
Reply with quote

Hi Guyz,

I tried out an sample program from ISPF Edit Macros manual, following is the macro
Code:
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
    "ISREDIT MACRO (HEADER)"         
SET &COUNT = 1                       
DO WHILE &COUNT <= 9                 
ISREDIT FIND  'TEST - #'               
SET &RETCODE = &LASTCC               
IF &RETCODE = 0 THEN                 
 DO                                   
  ISREDIT CHANGE  '#'   '&COUNT'         
  SET &COUNT = &COUNT + 1             
  END                                 
 ELSE                                 
  SET &COUNT = 10                     
  END                                 
EXIT                                 

I get the following error

Code:
     6 +++ ISREDIT MACRO SET &COUNT = 1               
Error running TEST1, line 6: Logical value not 0 or 1 
***                                                   

This is due to &COUNT. It is consider it as an Logical AND.
But this is how its given in the manual.
Where am i making the mistake, can i know ?

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

Global Moderator


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

PostPosted: Thu Jul 16, 2009 6:17 pm
Reply with quote

stop using clist and use rexx.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Jul 16, 2009 6:30 pm
Reply with quote

I agree, although the code was working fine for me.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Jul 16, 2009 6:34 pm
Reply with quote

Great Start,

So, What are the things i need to change to convert it into rexx ?

Sushanth
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Jul 16, 2009 6:51 pm
Reply with quote

Guyz,

I hope, i have converted my program to rexx
Code:
ADDRESS ISPEXEC "CONTROL ERRORS RETURN" 
    "ISREDIT MACRO (HEADER)"             
                                         
'ISREDIT COUNT = 1'                     
DO WHILE COUNT <= 9                     
'ISREDIT F "TEST - #"'                   
'ISREDIT RETCODE = LASTCC'               
IF RETCODE = 0 THEN                     
DO                                       
  'ISREDIT CHANGE  "#"  "&COUNT"'       
  'ISREDIT COUNT = COUNT + 1'           
END                                     
ELSE                                     
  'ISREDIT COUNT = 10'                   
END                                     
EXIT                                     


Now, iam getting lots of this
Code:
COMMAND RETCODE NOT FOUND
COMMAND COUNT NOT FOUND 
COMMAND RETCODE NOT FOUND
COMMAND COUNT NOT FOUND 
COMMAND RETCODE NOT FOUND
COMMAND COUNT NOT FOUND 
COMMAND RETCODE NOT FOUND
COMMAND COUNT NOT FOUND 
COMMAND RETCODE NOT FOUND


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

Global Moderator


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

PostPosted: Thu Jul 16, 2009 7:07 pm
Reply with quote

Not tested
Just changed by eye, so you might get an error or two
Code:

ADDRESS ISPEXEC "CONTROL ERRORS RETURN" 
    "ISREDIT MACRO (HEADER)"             
                                         
COUNT = 1                     
DO WHILE COUNT <= 9                     
'ISREDIT F "TEST - #"'                   
RETCODE = RC               
IF RETCODE = 0 THEN                     
DO                                       
  'ISREDIT CHANGE  "#"  "COUNT"'       
  COUNT = COUNT + 1           
END                                     
ELSE                                     
  COUNT = 10                   
END                                     
EXIT                       
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Jul 16, 2009 7:35 pm
Reply with quote

Expat,

Just changed yours from "COUNT" to "'count'".
Works Great.

I did something like this
Code:
/*REXX****************************************/
/* EDIT MACRO - TESTING **********************/
/*********************************************/
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"         
    "ISREDIT MACRO (HEADER)"                   
                                               
COUNT = 1                                       
DO WHILE COUNT <= 9                             
'ISREDIT F "TEST - #"'                         
  'ISREDIT CHANGE  "#"  "&COUNT"'               
COUNT = COUNT + 1                               
END                                             
EXIT                                           


In my code, i removed the returncode. Because, i didn't know what variable is used for return code. Thank You EXPAT, for telling me exactly that RC
Code:
RETCODE = RC



Sushanth
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Jul 16, 2009 9:11 pm
Reply with quote

sushanth bobby, where did you find that example? I could not find it in the book.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Jul 17, 2009 10:39 am
Reply with quote

Pedro,

ISPF Edit and Edit Macros
z/OS Version 1 Release 7.0
SC34-4820-04
Fifth Edition (September 2005)

Simplifying Complex Tasks - Page 87

Sushanth
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Jul 17, 2009 9:27 pm
Reply with quote

Quote:
I tried out an sample program from ISPF Edit Macros manual,
...
I get the following error


I looked at the manual... you did not faithfully copy it. Do not blame the manual if you change the example.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Fri Jul 17, 2009 9:29 pm
Reply with quote

I had a feeling ...
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Mon Jul 20, 2009 11:09 am
Reply with quote

OK. I am a bad copier.

Sushanth
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jul 22, 2009 1:50 am
Reply with quote

I did not intend to highlight your sloppiness *

I mentioned it because I (and several others) spend a great deal of time looking at the forum questions. I prioritize my time based on the topic and how interesting a puzzle it would be for me.

If you had used this subject line instead: "Error in the way I copied the sample program", I might have handled it differently.

* actually, I did.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Jul 22, 2009 10:34 am
Reply with quote

Yes, Pedro.
Next time, i'll do that.

Thanks,
Sushanth
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 Using API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top