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: 2038
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 Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Read of TDQ fails in LENGERR Tracy Hansen CICS 10 Wed Apr 05, 2017 12:10 am
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am


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