Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1060
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: 1243
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 MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts Failure after DIR command Hank Watson All Other Mainframe Topics 2 Tue Aug 29, 2017 3:14 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us