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

Read a string from cursor postion


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Tue Jul 29, 2008 12:17 pm
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: 1287
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 12:18 pm
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
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.

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: 1287
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 1:43 pm
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: 1287
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 1:47 pm
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
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: 2358
Location: Israel

PostPosted: Tue Jul 29, 2008 2:00 pm
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
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: 1287
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 3:17 pm
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
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

Global Moderator


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

PostPosted: Tue Jul 29, 2008 10:23 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
Search our Forums:

Back to Top