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

Not able to edit the dataset from outside the member


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Tue Sep 11, 2007 2:21 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Sep 11, 2007 2:28 pm
Reply with quote

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
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Tue Sep 11, 2007 2:33 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Sep 11, 2007 2:51 pm
Reply with quote

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
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Wed Sep 12, 2007 12:51 pm
Reply with quote

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
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Wed Sep 12, 2007 1:35 pm
Reply with quote

Thanks Diwakar.. Could you let me know what modifications needs to be done...
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top