Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Moving values from Stem Variable to Clip Board thru REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Sikkandhar

New User


Joined: 03 Dec 2007
Posts: 58
Location: Bangalore

PostPosted: Mon Jul 08, 2013 8:07 pm    Post subject: Moving values from Stem Variable to Clip Board thru REXX
Reply with quote

Hi,

I have a requirement to code a REXX tool to add/paste lines on the place where i have placed the cursor in the code

Assume the cursor is in line 390. I have to add few pre-defined lines (which i would be reading from a file and store it into a Stem Varaiable).

Code:
000390               MOVE 'A'                    TO WS-VARA   
000391               MOVE '2013-07-08'           TO WS-DATE   
000392               SET  WS-FLAG1               TO TRUE           


Is it possible to move the values in Stem variables to Clip Board? If so can you please help me with the command to push it to Clip Board.
Is it possible to add the lines directly onto the code (the program could be either opened in View mode or Edit mode) where i have placed the cursor instead of writing into a separate file? If so, can you please help me with the commands to do so

Thanks
Sikkandhar
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Mon Jul 08, 2013 9:17 pm    Post subject:
Reply with quote

It is possible to edit the clipboard and our forum member Prino has provided a macro to do so. Search for it if you are interested. However, IMHO, copying stem variables to clipboard will be a convoluted way to achieve what you are trying to do.

I think ISREDIT LINE_BEFORE/AFTER will suit perfectly for your requirement.

Suppse VAR1 is your variable then-
"ISREDIT LINE_BEFORE .zcsr = (VAR1)" should do the trick.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Mon Jul 08, 2013 10:45 pm    Post subject: Reply to: Moving values from Stem Variable to Clip Board thr
Reply with quote

Quote:
which i would be reading from a file and store it into a Stem Varaiable

Assuming that you are not modifying the records from the file, you can skip the stem variable by using the COPY statement.

Quote:
Is it possible to add the lines directly onto the code

For example:
Code:
Address ISREDIT
"COPY  'my.dsn' AFTER .zcsr"
Back to top
View user's profile Send private message
Sikkandhar

New User


Joined: 03 Dec 2007
Posts: 58
Location: Bangalore

PostPosted: Tue Jul 09, 2013 12:32 pm    Post subject:
Reply with quote

Thank agkshirsagar
Will the statement hold good for Stem Variable?

"ISREDIT LINE_BEFORE .zcsr = (VAR1)"
VAR1 is a Stem Variable

Pedro,

I need to do some modifications to the content i read. Hence i cannot directly copy to Clip Board.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jul 09, 2013 1:04 pm    Post subject: Re: Reply to: Moving values from Stem Variable to Clip Board
Reply with quote

Pedro wrote:
Assuming that you are not modifying the records from the file, you can skip the stem variable by using the COPY statement.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Jul 09, 2013 4:58 pm    Post subject:
Reply with quote

Sikkandhar wrote:
Thank agkshirsagar
Will the statement hold good for Stem Variable?

"ISREDIT LINE_BEFORE .zcsr = (VAR1)"

You might be better off using LINE_AFTER in a loop with VAR1.i.
Back to top
View user's profile Send private message
Sikkandhar

New User


Joined: 03 Dec 2007
Posts: 58
Location: Bangalore

PostPosted: Tue Jul 09, 2013 5:11 pm    Post subject:
Reply with quote

Quote:
I need to do some modifications to the content i read. Hence i cannot directly copy to Clip Board.


I Apologise, if i had offended anyone.

I have loaded the Stem Variable with the content. Assume that the stem variable is VAR1. Coded the below lines

Code:
000150    "ISREDIT MACRO"                                 
000151    "ISREDIT LINE_BEFORE .ZCSR = (VAR1.)"           
000152    ADDRESS ISREDIT "END"                           
000153    EXIT     


When i execute the REXX from the program (opened in View Mode) where i intended to insert the lines, no insertions were done.
Could anyone please help me on the above?

The Stem variable is loaded with right content. Verified by displaying them.

Thanks
Sikkandhar
Back to top
View user's profile Send private message
Sikkandhar

New User


Joined: 03 Dec 2007
Posts: 58
Location: Bangalore

PostPosted: Tue Jul 09, 2013 5:15 pm    Post subject:
Reply with quote

Just saw your post Akatsukami

Quote:
You might be better off using LINE_AFTER in a loop with VAR1.i.


Tried with VAR1.1 (just wanted to check whether atleast 1 line is getting inserted), but no insertion was done

Code:
ADDRESS ISPEXEC                             
"ISREDIT MACRO"                             
"ISREDIT LINE_AFTER .ZCSR = (VAR1.1)"     
ADDRESS ISREDIT "END"                       
EXIT   
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Tue Jul 09, 2013 5:31 pm    Post subject:
Reply with quote

I would check the edit macro manual and see what the syntax says - it probably does not allow a stem so you would have to do your insert inside a loop in which your stem variables would be assigned to a static name that ISREDIT can use.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Jul 09, 2013 7:03 pm    Post subject:
Reply with quote

Sikkandhar wrote:
Just saw your post Akatsukami

Quote:
You might be better off using LINE_AFTER in a loop with VAR1.i.


Tried with VAR1.1 (just wanted to check whether atleast 1 line is getting inserted), but no insertion was done

Code:
ADDRESS ISPEXEC                             
"ISREDIT MACRO"                             
"ISREDIT LINE_AFTER .ZCSR = (VAR1.1)"     
ADDRESS ISREDIT "END"                       
EXIT   

Most peculiar. This code works for me; give it a try:
Code:
/* Rexx */                                                             
/*********************************************************************/
/*                                                                   */
/* Written Heisei 25.07.09 by Akatsukami-sama.                       */
/*                                                                   */
/*********************************************************************/
  ADDRESS ISREDIT "MACRO (DSN)"                                       
  trace o                                                             
  sig      = x2c("E69989A3A3859540C88589A2858940F2F54BF0F74BF0F940")   
  sig      = sig || x2c("82A840C19281A3A2A49281948960A2819481")       
  "ALLOC FI(FO) DA('"dsn"') SHR"                                       
  "EXECIO * DISKR FO (STEM STEM. FINIS"                               
  "FREE FI(FO)"                                                       
  address isredit "(L1) = CURSOR"                                     
                                                                       
  do i = 1 to stem.0                                                   
    address isredit "LINE_AFTER &L1 = '"stem.i"'"                     
    l1 = l1 + 1                                                       
  end                                                                 
                                                                       
  exit                                                                 
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Wed Jul 10, 2013 2:47 am    Post subject: Reply to: Moving values from Stem Variable to Clip Board thr
Reply with quote

Code:
"ISREDIT LINE_AFTER .ZCSR = (VAR1.1)"


Explanation: everything between the quotes is passed to the ISPF command processor, which does not know anything about stem variables.

Akatsukami-san's code works because the variable name is outside of the quotes. It is resolved by the rexx processor before sending it to the ISPF command processor.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us