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

Query on edit primary command


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
PriyaMougoundane

New User


Joined: 28 Jul 2023
Posts: 4
Location: India

PostPosted: Fri Jul 28, 2023 3:42 pm
Reply with quote

Hi,

I trying to build a macro to perform copy based on the labels and lines I provide from the source member to the destination member without doing the work of creating and paste it in another window. Thought I have given the destination member where the data has to be pasted, It's trying to paste the contents to the source member itself.

Below is my code for your reference

/**REXX****/
ADDRESS ISREDIT
"MACRO (DNAME)"
"(MEM) = MEMBER"
"CREATE "DNAME" .A .B"
IF RC /= 0 THEN
"CUT .A .B "MEM""
"PASTE "DNAME" AFTER .ZLAST"

Is there any other way to change the clipboard?

Below mentioned is the error I am receiving

Command in error . : PASTE CRE8 AFTER .ZLAST

Use CUT before PASTE
No lines exist in the clipboard named CRE8 or the clipboard does not exist

Error message ID . : ISRP133

Last return code . : 12


can you you please guide me on this and I am new to macros

Regards,
Priya Mougoundane.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Fri Jul 28, 2023 4:49 pm
Reply with quote

Consider using trace for debugging.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2131
Location: USA

PostPosted: Fri Jul 28, 2023 5:13 pm
Reply with quote

Consider using the Code button when posting.
Be polite to your potential readers.
Code:
/**REXX****/
ADDRESS ISREDIT
"MACRO (DNAME)"
"(MEM) = MEMBER"
"CREATE "DNAME" .A .B"
IF RC /= 0 THEN
   "CUT .A .B "MEM""
   "PASTE "DNAME" AFTER .ZLAST"
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Fri Jul 28, 2023 6:42 pm
Reply with quote

The argument for PASTE is not a member name, but a clipboard name. They are different 'objects'.
Code:
   "PASTE "DNAME" AFTER .ZLAST"


What you need to do is split into two different editor macros:
Code:

"CUT .A .B MYCLIP  REPLACE" /*to named clipboard */
Address ISPEXEC "EDIT DATASET(my.dsn("DNAME")) MACRO(mymac2)"


and
Code:
/**REXX****/
ADDRESS ISREDIT
"MACRO ()"
"PASTE MYCLIP  AFTER .ZLAST"  /*from named clipboard*/
"SAVE"
"END"


Note the REPLACE parm on the CUT statement (otherwise, you may get residual data from earlier), though that might be a personal preference.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Fri Jul 28, 2023 6:49 pm
Reply with quote

hmmm, on second thought, just use REPLACE instead of CREATE.
Code:
/**REXX****/
ADDRESS ISREDIT
"MACRO (DNAME)"
"(MEM) = MEMBER"
"REPLACE "DNAME" .A .B
Back to top
View user's profile Send private message
PriyaMougoundane

New User


Joined: 28 Jul 2023
Posts: 4
Location: India

PostPosted: Sat Jul 29, 2023 10:57 am
Reply with quote

Thank you for your timely suggestions, It works perfectly fine.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts How to Login in to cics region and is... CICS 9
No new posts Passing containers on START command CICS 4
Search our Forums:

Back to Top