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
 

 

Can we pass a variable to SEEK command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Wed Jul 29, 2009 4:33 pm    Post subject: Can we pass a variable to SEEK command
Reply with quote

Hi,

Can we pass a variable to SEEK like,
Code:
DO I = 1 TO LINES.0             
LINES.I=STRIP(LINES.I)         
"ISREDIT SEEK ALL '&LINES.I'"   
"ISREDIT (COUNT) = SEEK_COUNTS"
SAY LINES.I "=" COUNT           
END                             

LINES variable has following data,
Code:
LINE
REX
ISREDIT
SAY

This is not working.. I am getting the following output
LINE = 00000030
REX = 00000030
ISREDIT = 00000030
SAY = 00000030

Sushanth
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: Wed Jul 29, 2009 4:49 pm    Post subject:
Reply with quote

I take it that your code is in a macro rather than just open code.

Tried SEEK but it came up with command not found, but FIND works.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Wed Jul 29, 2009 5:23 pm    Post subject:
Reply with quote

Expat,

Yes it is a macro. Following is the code with FIND
Code:
/**** REXX ************************************/     
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"             
    "ISREDIT MACRO (HEADER)"                         
                                                     
"ALLOC DA('HXSULL.TEST(ISTTI)') F(INPUT) SHR REUSE" 
"EXECIO * DISKR INPUT (STEM LINES. FINIS"           
                                                     
DO I = 1 TO LINES.0                                 
LINES.I=STRIP(LINES.I)                               
"ISREDIT FIND ALL '&LINES.I'"                       
"ISREDIT (COUNT) = FIND_COUNTS"                     
SAY LINES.I "=" COUNT                               
END                                                 
"FREE F(INPUT)"                                     
EXIT                                                 


I ran it on the same and got the following results
Code:
LINE = 00000032     
REX = 00000032       
ISREDIT = 00000032   
SAY = 00000032       


Instead of SEEK, if i run it with SEEK & SEEK_COUNTS. I get the following results.
Code:
LINE = 00000030   
REX = 00000030   
ISREDIT = 00000030
SAY = 00000030   


After running it with FIND, seeing the result and when i came back to my screen. All the 'i' letters were highlighted. So, i did a
Code:
F ALL 'i'

The result was 32.

So, i just tried with a variable like L='ISREDIT'
Code:
"ISREDIT FIND ALL '&L'"                       


It gave me 3. yes thats true.

So, i am wondering can a stem variable be passed as a parameter to FIND or SEEK.

Sushanth
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1002
Location: Oostende, Belgium

PostPosted: Wed Jul 29, 2009 5:24 pm    Post subject:
Reply with quote

Check the single and double quotes:

Code:
"isredit seek all '"lines.i"'"


And don't write REXX in UPPERCASE!
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1226
Location: Israel

PostPosted: Wed Jul 29, 2009 5:32 pm    Post subject:
Reply with quote

Make two small changes to your code:
Code:
DO I = 1 TO LINES.0
   LINES.I=STRIP(LINES.I)
   "ISREDIT SEEK ALL '"LINES.I"'"
   "ISREDIT (COUNT) = SEEK_COUNTS"
   SAY LINES.I "=" COUNT
END

(the second change is: use indentation to improve readability)
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Wed Jul 29, 2009 5:51 pm    Post subject:
Reply with quote

Thank You Marso & Prino.
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm


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