Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Not able to edit the dataset from outside the member

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Not able to edit the dataset from outside the member
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: 2360
Location: Israel

PostPosted: Tue Sep 11, 2007 2:28 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Sep 11, 2007 2:51 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us