View previous topic :: View next topic
|
Author |
Message |
PriyaMougoundane
New User
Joined: 28 Jul 2023 Posts: 4 Location: India
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Consider using trace for debugging. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2131 Location: USA
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
PriyaMougoundane
New User
Joined: 28 Jul 2023 Posts: 4 Location: India
|
|
|
|
Thank you for your timely suggestions, It works perfectly fine. |
|
Back to top |
|
|
|