View previous topic :: View next topic |
Author |
Message |
Meg Beginner
Joined: 08 Jul 2003 Posts: 44 Topics: 16
|
Posted: Thu Feb 12, 2004 4:15 am Post subject: Rertun code from a macro. |
|
|
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 |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Thu Feb 12, 2004 8:35 pm Post subject: |
|
|
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 |
|
|
Meg Beginner
Joined: 08 Jul 2003 Posts: 44 Topics: 16
|
Posted: Fri Feb 13, 2004 9:12 am Post subject: |
|
|
U are right Maton_Man. I had not saved the dataset. Thank u.
Meg |
|
Back to top |
|
|
ramu_mohan21 Beginner
Joined: 29 Jun 2004 Posts: 106 Topics: 41 Location: Bangalore, INDIA
|
Posted: Fri Jan 07, 2005 10:34 am Post subject: |
|
|
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 |
|
|
ramu_mohan21 Beginner
Joined: 29 Jun 2004 Posts: 106 Topics: 41 Location: Bangalore, INDIA
|
Posted: Fri Jan 07, 2005 10:41 am Post subject: |
|
|
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 |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
|
Back to top |
|
|
|
|