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
 

 

Read a string from cursor postion

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

New User


Joined: 21 Jun 2007
Posts: 14
Location: India

PostPosted: Tue Jul 29, 2008 11:15 am    Post subject: Read a string from cursor postion
Reply with quote

I'm trying to read a string from current cursor postion. I got how to get the cursor postion using

ADDRESS ISREDTT '(ROW,COL) = CURSOR'

How can I read a string in an EDIT macro?
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jul 29, 2008 12:17 pm    Post subject:
Reply with quote

ISPF editor assigns a "secret" label for the current cursor position, and names it .ZCSR.

You can then use the LINE command to retrieve the line's content.

O.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 12:18 pm    Post subject: Reply to: Read a string from cursor postion
Reply with quote

Joe,

Quote:
How can I read a string in an EDIT macro?


Once you have got the cursor position, you need to find the string and move it to a variable.

You can move the line to a variable using the foll code


Code:
"ISREDIT (TEXTLINE) = LINE .ZCSR"


Then you can set the limits and use SUBSTR to copy just the field.

Code:
STRING = SUBSTR(TEXTLINE,START-POS,LENGTH)


You will get better answers if you explain your requirement clearly.
Back to top
View user's profile Send private message
joejacob

New User


Joined: 21 Jun 2007
Posts: 14
Location: India

PostPosted: Tue Jul 29, 2008 12:24 pm    Post subject:
Reply with quote

I'm developing a tool to search for a string in a member of PDS. If I place cursor under the string to be searched an press F5 the macro should read that word and go to next occurrence of the word.

Please see my previous post for more info.

http://ibmmainframes.com/viewtopic.php?p=144122#144122

can I use space as a delimiter (instead of length) so that I can get the word.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 1:43 pm    Post subject: Reply to: Read a string from cursor postion
Reply with quote

Joe,

Quote:
If I place cursor under the string to be searched an press F5 the macro should read that word and go to next occurrence of the word.


Why should it go the next occurence of the word? or you want the tool to search the word in all the members of the PDS? Please mention your requirement clearly.

Quote:
can I use space as a delimiter (instead of length) so that I can get the word.


Yes, you can use any symbol as a delimiter. Do as mentioned below.

- get the cursor position
- find " " (space) using the foll statement

Code:
"ISREDIT FIND NEXT .ZCSR .ZCSR ' '"


- move the column no to a variable

Code:
"ISREDIT (R1 C3) = CURSOR"


then use the LINE and SUBSTR to get the word. Also please refer the manuals.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 1:47 pm    Post subject: Reply to: Read a string from cursor postion
Reply with quote

Joe,

Quote:
Please see my previous post for more info.


As suggested in the previous post link, Read the manuals, understand the macro instructions and post if you still face any problem.
Back to top
View user's profile Send private message
joejacob

New User


Joined: 21 Jun 2007
Posts: 14
Location: India

PostPosted: Tue Jul 29, 2008 1:58 pm    Post subject:
Reply with quote

Yes I'm developing a tool to search a word (working storage varible) in a member. It is like FIND tool instead of giving the string as argument the string to be searched is read from the cursor position.

I'm stuck at another point I cannot find how to use PF keys in rexx macro

IF PFKEY = "PF04"

the above code is not working in macro.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jul 29, 2008 2:00 pm    Post subject:
Reply with quote

I believe you are mixing REXX, ISPF & Edit-Macro.

Have you read the relevant manuals?

O.
Back to top
View user's profile Send private message
joejacob

New User


Joined: 21 Jun 2007
Posts: 14
Location: India

PostPosted: Tue Jul 29, 2008 2:10 pm    Post subject:
Reply with quote

I'm not mixing I know the

IF PFKEY = "PF04"

will work only with panels what is its equivalent in macros I need to read the string when I press a PF key.

I'm new to REXX icon_sad.gif
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 3:17 pm    Post subject: Reply to: Read a string from cursor postion
Reply with quote

Joe,

Quote:
what is its equivalent in macros I need to read the string when I press a PF key.


You are mixing evrything for sure.

From your previous post

Quote:
If I place cursor under the string to be searched an press F5 the macro


My understanding is that, you want to create a macro and then execute/invoke it using that a PF key. Am i correct?
Back to top
View user's profile Send private message
joejacob

New User


Joined: 21 Jun 2007
Posts: 14
Location: India

PostPosted: Tue Jul 29, 2008 3:50 pm    Post subject:
Reply with quote

Yes, I got it right Thanks for the help. I mapped the PF key to my program.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Tue Jul 29, 2008 10:23 pm    Post subject: Reply to: Read a string from cursor postion
Reply with quote

Quote:
I mapped the PF key to my program.

Not sure what that means, just guessing...

But as an user, I get upset when the keys do not work as intended. Please do not change PF keys settings programmatically. PF key definitions should be defined through a keylist or through the xxxxPROF member and available when your tool is installed. If the user chooses to changes the keys, the changes should be honored.
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 Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


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