MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Rertun code from a macro.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Thu Feb 12, 2004 4:15 am    Post subject: Rertun code from a macro. Reply with quote

I have Rexx routine that is as follows
Code:

/* REXX */                                                 
ID = SYSVAR(SYSUID)                                         
ADDRESS ISPEXEC                                             
IDSN ="'"MY.DATASET"'"                                     
"LMINIT DATAID(INDD) DATASET("IDSN") ENQ(SHR)"             
"LMOPEN DATAID(&INDD)"                                     
ADDRESS ISPEXEC "VPUT (ID) SHARED"                         
"EDIT DATAID("INDD") MACRO(FNDGMAC)"                         
SAY RC

The macro FNDGMAC just searches for the ID in the INDD and if the return code is 0 then it displays a msg1 else it does msg2. Inside the macro the retrun code RC is 0 bu after the macro is executed, the RC becomes 4. Can anyone explain why this is happening.
For reference the macro is as follows,
Code:

/* REXX */                             
ADDRESS ISPEXEC "VGET (ID) SHARED"     
ADDRESS ISREDIT                       
"MACRO"                               
"F ALL "ID""                           
"END"                                 
IF RC = 0 THEN                         
   SAY 'ALLOWED'                       
ELSE                                   
   SAY 'NOT ALLOWED'
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Thu Feb 12, 2004 8:35 pm    Post subject: Reply with quote

If you look at the valid return codes for the ISPF EDIT Service which is what you are invoking, then you will see that RC 4 means - Data not saved.

So you have edited and it is telling you that none of your changes (should you have made any) have been saved.
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Fri Feb 13, 2004 9:12 am    Post subject: Reply with quote

U are right Maton_Man. I had not saved the dataset. Thank u.
Meg
Back to top
View user's profile Send private message
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Fri Jan 07, 2005 10:34 am    Post subject: Reply with quote

Hi Board,
Can we change the return code in the Macro. My requirement is depending on the return code I wanted to execute some code in Main REXX. I wanted to pass my value in Return Code within the MACRO. Can we do like that?

If it is not possible:
I wanted to pass some value from Macro to Main REXX. How it can be obtained. Any one can give me clarification.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
ramu_mohan21
Beginner


Joined: 29 Jun 2004
Posts: 106
Topics: 41
Location: Bangalore, INDIA

PostPosted: Fri Jan 07, 2005 10:41 am    Post subject: Reply with quote

In addition to the above information:
I have done like below also-
Quote:

If Condition then
do;
RC = 10
end;

If Codition then
do;
RC = 11
end;


Still the return code value is not getting changed in main REXX.
_________________
Best Regards,
----------------
Rammohan Pabba
Software Engineer
Back to top
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Fri Jan 07, 2005 10:54 am    Post subject: Reply with quote

If you're not changing anything, you don't need the END command.

To return different codes, try the EXIT command http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ2A304/3.6?DT=19951106081441
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group