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: 8631
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: 1074
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: 1258
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am

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