ISREDIT macro not getting called from rexx exec



IBM's Command List programming language & Restructured Extended Executor

ISREDIT macro not getting called from rexx exec

Postby sumitmishra » Fri Sep 26, 2014 7:08 pm

Hi,

I am trying to get multiple members in a PDS to get updated for a input value which I am asking user to enter but it gives me a message that "macro not found" after showing all the members sequentially.

Please see the below rexx exec:

/* REXX ***/
SAY "ENTER THE DSN NAME.. ONLY"
PULL DSN
SAY "ENTER FROM DISS :"
PULL INPUT1
SAY "ENTER TO DISS :"
PULL INPUT2
   "ISPEXEC VPUT (DSN) SHARED"
   "ISPEXEC VPUT (INPUT1) SHARED"
   "ISPEXEC VPUT (INPUT2) SHARED"
SAY DSN
X = OUTTRAP('SS.')
"LISTDS '"DSN"' MEMBERS"
X = OUTTRAP('OFF')
DO I = 7 TO SS.0
PARSE VAR SS.I MEM
MEM=STRIP(MEM)
SAY "MEMBER NAME IS:" MEM
ADDRESS ISPEXEC "EDIT DATASET("DSN") MACRO(IM001)"
ADDRESS ISREDIT
"CHANGE REXX HI ALL"
"SAVE"
"MEND"
END

and the macro IM001:

/*REXX*/
ISREDIT "MACRO PROCESS"
TRACE OFF
"ISREDIT (USTAT) = USER_STATE"
"ISPEXEC VGET (ENDEXEC) SHARED"
"ISPEXEC VGET (INPUT2) SHARED"
"ISPEXEC VGET (INPUT1) SHARED"
ISREDIT "C ALL " INPUT1 INPUT2
ISREDIT "RESET "
ISREDIT "END"
EXIT

I know it can be best done through panels but As I am a beginner I would like to do it first in this way.

Please pardon any silly mistake.
Thanks,
Sumit
sumitmishra
 
Posts: 7
Joined: Fri Sep 26, 2014 7:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ISREDIT macro not getting called from rexx exec

Postby Pedro » Fri Sep 26, 2014 9:16 pm

You need to include a member name here:
ADDRESS ISPEXEC "EDIT DATASET("DSN") MACRO(IM001)"

Currently, I believe DSN is only the data set name.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: ISREDIT macro not getting called from rexx exec

Postby Pedro » Fri Sep 26, 2014 9:19 pm

I do not think your main rexx executes from within the editor. These will not work here and should be removed:
ADDRESS ISREDIT
"CHANGE REXX HI ALL"
"SAVE"
"MEND"

Anyway, MEND is obsolete.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: ISREDIT macro not getting called from rexx exec

Postby sumitmishra » Fri Sep 26, 2014 11:16 pm

HI Pedro, Thanks a lot for the reply. My motive is to update all the members inside the PDS, which I am taking as input from user and it is captured in the DSN variable. Along with DSN there are 2 more inputs from user one is the source string and other to replace the source string.
When I am executing the rexx exec, it take me inside the PDS

 EDIT     TPU232.TEST.MYUTIL
 Command ===>
    Name     Prompt          Size    Created
 . TEST1                        1   2014/09/25
 . TEST2                        1   2014/09/25
 . TEST3                        1   2014/09/25

WHen I press F3, it says "MEMBER NAME IS: TEST2," and like wise it repeats for all the members and finally RC=0
sumitmishra
 
Posts: 7
Joined: Fri Sep 26, 2014 7:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ISREDIT macro not getting called from rexx exec

Postby Pedro » Sat Sep 27, 2014 6:18 am

You are getting the member list because you do not specify a member name on the EDIT call. If you provide the member name, you will not see the member list.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: ISREDIT macro not getting called from rexx exec

Postby sumitmishra » Sat Sep 27, 2014 9:27 am

Hi Pedro,

I have modified my program to include the member list as well but when I execute my rexx it gives the below message

TOTAL 3 MEMBERS OF XXXXXX.TEST.MYUTIL TO BE PROCESSED..........
MEMBERS   STATUS,
COMMAND IM001 NOT FOUND,

IM001 is my macro. When I press ENTER, it again takes me inside the PDS and gives the error "Macro does not exist" as mentioned below:

EDIT      ,XXXXXX.TEST.MYUTIL(TEST1) - 01.00             ,Macro does not exist,
Command ===>,IM001                                           ,Scroll ===>,CSR ,
******,***************************** Top of Data ******************************
000001,ABC
******,**************************** Bottom of Data ****************************

I have read in a earlier post, the my library should be concatenated with SYSPROC, but here I am using 'exec' to execute my program and also I have checked that I don't have access to any of the SYSPROC libraries.

Could you please have a look and tell me where I am making the error. The new code is as mentioned below:

/******************REXX*******************/
ISREDIT "MACRO PROCESS"

SAY "ENTER OLD DISSECTION NAME :"
PULL INPUT1

SAY "ENTER NEW DISSECTION NAME :"
PULL INPUT2

SAY "ENTER PDS NAME :"
PULL MDSN

IF SYSDSN(MDSN) \= "OK" THEN
   "ISPEXEC VPUT (INPUT1) SHARED"
   "ISPEXEC VPUT (INPUT2) SHARED"
   "ISPEXEC VPUT (MDSN) SHARED"
   X=OUTTRAP('N.')
   SAY MDSN
   "LISTDS" MDSN "MEMBER"
   X=OUTTRAP('OFF')
   SAY " "
   SAY "TOTAL" N.0-6 "MEMBERS OF",
       MDSN "TO BE PROCESSED.........."
   SAY "MEMBERS   STATUS "
    DO I=7 TO N.0
    MEM=STRIP(N.I,B)
    MYFILE=MDSN || '(' || MEM || ')'
   ADDRESS ISPEXEC "EDIT DATASET("MYFILE") MACRO(IM001)"
   SAY MEM  " PROCESSED SUCCESSFULLY"
END
DROP N.

Macro is same as mentioned in an earlier post.

Thanks,
Sumit
sumitmishra
 
Posts: 7
Joined: Fri Sep 26, 2014 7:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ISREDIT macro not getting called from rexx exec

Postby sumitmishra » Sat Sep 27, 2014 4:25 pm

Hi Pedro,

The program ran successfully and updated all the members as desired but there is a peculiar problem coming, It ran fine for the first time but when I am trying to run it again even though it says all the members processed successfully as mentioned below but it does not update the members actually.

TOTAL 3 MEMBERS OF XXXXXX.TEST.MYUTIL TO BE PROCESSED..........,
MEMBERS   STATUS,
TEST1  PROCESSED SUCCESSFULLY,
TEST2  PROCESSED SUCCESSFULLY,
TEST3  PROCESSED SUCCESSFULLY,


I have used the below code to concatenate my library to SYSPROC.

/* REXX */                                       
"ALLOC F(MYPDS) DA('XXXXXX.TEST.UTIL') SHR REU"   
CALL BPXWDYN "CONCAT DDLIST(SYSPROC,MYPDS) MSG(2)"
EXIT 0


Below is rexx exec:

/******************REXX*******************/
ISREDIT "MACRO PROCESS"

SAY "ENTER OLD DISSECTION NAME :"
PULL INPUT1

SAY "ENTER NEW DISSECTION NAME :"
PULL INPUT2

SAY "ENTER PDS NAME :"
PULL MDSN

IF SYSDSN(MDSN) \= "OK" THEN
   "ISPEXEC VPUT (INPUT1) SHARED"
   "ISPEXEC VPUT (INPUT2) SHARED"
   "ISPEXEC VPUT (MDSN) SHARED"
   X=OUTTRAP('N.')
   SAY MDSN
   "LISTDS" MDSN "MEMBER"
   X=OUTTRAP('OFF')
   SAY " "
   SAY "TOTAL" N.0-6 "MEMBERS OF",
       MDSN "TO BE PROCESSED.........."
   SAY "MEMBERS   STATUS "
    DO I=7 TO N.0
    MEM=STRIP(N.I,B)
    MYFILE=MDSN || '(' || MEM || ')'
   ADDRESS ISPEXEC "EDIT DATASET("MYFILE") MACRO(IM001)"
   SAY MEM  " PROCESSED SUCCESSFULLY"
END
DROP N.

Macro IM001:

/*REXX*/
ISREDIT "MACRO PROCESS"
TRACE OFF
"ISREDIT (USTAT) = USER_STATE"
/*"ISPEXEC VGET (ENDEXEC) SHARED"*/
"ISPEXEC VGET (INPUT1) SHARED"
"ISPEXEC VGET (INPUT2) SHARED"
"ISPEXEC VGET (MDSN) SHARED"
ISREDIT "C ALL " INPUT1 INPUT2
ISREDIT "SAVE"
ISREDIT "END"
EXIT

I am not able to understand why it ran fine for the first time and not after that. Can you please help me with this issue?

Thanks,
Sumit
sumitmishra
 
Posts: 7
Joined: Fri Sep 26, 2014 7:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ISREDIT macro not getting called from rexx exec

Postby Pedro » Mon Sep 29, 2014 7:33 pm

The code looks good.

Can you provide a sample member? What are your two input values?
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: ISREDIT macro not getting called from rexx exec

Postby NicC » Mon Sep 29, 2014 7:58 pm

Why do you have ISREDIT "MACRO PROCESS" at the start of your program? It is not a macro, is it?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: ISREDIT macro not getting called from rexx exec

Postby sumitmishra » Tue Sep 30, 2014 4:40 pm

Hi Pedro,

The PDS which I am taking as input from screen is 'XXXXXX.TEST.MYUTIL' and it has 3 members (test1, test2, test3) with the value 'ABC'
So the process after executing the rexx exec is as mentioned below:
ENTER OLD DISSECTION NAME : ABC
ENTER NEW DISSECTION NAME: PPP
ENTER PDS NAME : XXXXXX.TEST.MYUTIL

When I press enter, it gives the below messages:

TOTAL 3 MEMBERS OF XXXXXX.TEST.MYUTIL TO BE PROCESSED..........
MEMBERS STATUS,
TEST1 PROCESSED SUCCESSFULLY,
TEST2 PROCESSED SUCCESSFULLY,
TEST3 PROCESSED SUCCESSFULLY,
***,

Expected result is all the members should have replaced 'ABC' by 'PPP'. But when I check the members, the expected updates did not happened. At present I am taking input though 'SAY' and 'PULL', Later I am planning to use panels for this.

Also to concatenate my library (where my rexx exec is kept) I am using the below code which concatenates my library to SYSPROC, but this is a temporary concatenation (which remains there from Mainframe up to down). I do not have SYSEXEC listed in from 'TSO ISRDDN'

"ALLOC F(MYPDS) DA('TPU232.TEST.UTIL') SHR REU"
CALL BPXWDYN "CONCAT DDLIST(SYSPROC,MYPDS) MSG(2)"
EXIT 0

Thanks,
Sumit
sumitmishra
 
Posts: 7
Joined: Fri Sep 26, 2014 7:02 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post