View previous topic :: View next topic
|
Author |
Message |
Indrajit_57 Warnings : 1 New User
Joined: 27 Jun 2006 Posts: 60
|
|
|
|
I want to insert certain lines in a particular member of PDS by comparing it with another member. The code seems to work fine if the rexx is invoked within the member. However the same is not gettong reflected if I run that through some other panel. Can someone help in what I am doing wrong. Here is the code: -
/* REXX */
/* */
/* ADDRESS ISREDIT "MACRO" */
clear
ISREDIT MACRO
"ISREDIT RESET"
ZFIRST = 5
SAY 'ENTER SOURCE (BASE) PDS NAME WITHOUT QUOTES: '
PULL DSN1
SAY 'ENTER TARGET PDS NAME WITHOUT QUOTES: '
PULL DSN2
SAY 'ENTER TARGET MEMBER NAME WITHOUT QUOTES: '
PULL MEM
ADDRESS TSO "FREE F(AAAC)"
DD1 = "'" || DSN1 || '(' || MEM || ')' || "'"
DD2 = "'" || DSN2 || '(' || MEM2 || ')' || "'"
address ispexec
"EDIT DATASET('"DSN1"("MEM")')"
address tso
"ALLOC DD(AAAC) DA("DD1") SHR"
"ALLOC DD(AAAD) DA("DD2") SHR"
"EXECIO * DISKR AAAC (STEM AR1. FINIS"
"EXECIO * DISKR AAAD (STEM AR2. FINIS"
A1 = AR1.0
B1 = AR2.0
L=1
DO J=1 TO A1 BY 1
A = AR1.J
B = AR2.L
IF L <= B1 THEN DO
CALL RETROLINE
END
END
ADDRESS isredit SORT
address isredit save
EXIT
RETROLINE:
PARSE VAR A
PARSE VAR B
say a
say b
LINENBRA = SUBSTR(A,1,6)
LINENBRB = SUBSTR(B,1,6)
LINEA = "'" || A || "'"
LINEB = "'" || B || "'"
IF LINENBRA = LINENBRB THEN DO
ADDRESS isredit CHANGE LINEA LINEB
L=L+1
END
IF LINENBRA > LINENBRB THEN DO
ADDRESS isredit "(FRED) = " CURSOR
ADDRESS isredit "LINE_AFTER "FRED " = " DATALINE (LINEB)
IF L ¬= B1 THEN DO
L = L+1
B = AR2.L
CALL RETROLINE
END
END
RETURN |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
What do you mean by "run that through some other panel"?
The code above in an ISPF Edit-Macro, and should be invoked only from within ISPF editor as an editor command.
O. |
|
Back to top |
|
|
Indrajit_57 Warnings : 1 New User
Joined: 27 Jun 2006 Posts: 60
|
|
|
|
I want to invoke the rexx from the main start menu...or from anywhere without actually going to the member.
I am new to REXX so I dont have much idea on it. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You can't. As already said - This is an edit macro, and it is using edit macro commands. You can't invoke it outside ISPF editor.
O. |
|
Back to top |
|
|
diwa_thilak
Active User
Joined: 13 Jul 2006 Posts: 205 Location: At my desk
|
|
|
|
Indrajit,
If you want to execute the code as a normal rexx routine then you need to remove the ISREDIT macro code and you may need to reformat the code.
Incase of normal rexx routines, you can invoke and make it run from anywhere (irrespective the ispf editor). If it is an Edit macro (first 5 lines in your code hilights this to be a macro), you can execute only inside an ISPF editor.
Get back to me, if you still have any queries.
Cheers,
Diwakar
---------------
Nobody is Perfect. I am Nobody |
|
Back to top |
|
|
Indrajit_57 Warnings : 1 New User
Joined: 27 Jun 2006 Posts: 60
|
|
|
|
Thanks Diwakar.. Could you let me know what modifications needs to be done... |
|
Back to top |
|
|
|