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

How to retrieve a line from a program by running the rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arund

New User


Joined: 25 Aug 2005
Posts: 1

PostPosted: Tue Aug 30, 2005 10:36 am
Reply with quote

Hi,

How to retrieve a line from a program by running the rexx program.
For eg, say I have a code like this..

00001 Id Division.
00002 Program-Id. sample.
00003 envronment division.
and so on...
Now I want to get the string on line number 3 .. Is there any function for that..
Back to top
View user's profile Send private message
Ravi gaur

New User


Joined: 12 Jul 2005
Posts: 38

PostPosted: Tue Aug 30, 2005 11:44 am
Reply with quote

Arund make it more clear ,,

However Through EXECIO i mostly read records...
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Tue Aug 30, 2005 1:21 pm
Reply with quote

I think that with a stem you will have some chance.
This is a sample:
Code:
"Execio * DiskR INPUT(Stem MySource. Finis"
Say MySource.3 /* envronment division. */


If you want to loop into your stem you can have this situation:

Code:
Do i = 1 To MySource.0 /*total of element in the stem MySource.*/
  Say MySource.i /* display your entire program line per line*/
End

Otherwise if you want to read in other way you can use Execio without Stem:
Code:
"Execio 0 DiskR INPUT(Open"
"Execio 1 DiskR INPUT 3"
"Execio 0 DiskR INPUT(Finis"


For more information you can see the Rexx Manual at this link:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/IKJ4A350/10.3?DT=20040623084642
Back to top
View user's profile Send private message
dietocode

New User


Joined: 14 Nov 2005
Posts: 1
Location: Bangalore-India

PostPosted: Mon Nov 14, 2005 9:47 am
Reply with quote

Hi arun,
If your requirement is to pick the line of nuber what you have mentioned , all you need to do is have a counter and then go on performing reads until teh counter reaches the no you have set. Else teh easier way is to read the entire file into a stem and then only display stem.numberofyourchoice.Let me know if you need code snippet.
Back to top
View user's profile Send private message
sonipankaj

New User


Joined: 23 Nov 2005
Posts: 10

PostPosted: Thu Nov 24, 2005 8:36 pm
Reply with quote

You can use Cursor position to read the data from that line.
[ADDRESS ISREDIT
"MACRO PROCESS"
"(LINEDATA) = LINE .ZCSR" ]
It will return the data of the line in which your cursor is placed.
It is used in Macro.
Back to top
View user's profile Send private message
rabindranathtawker

New User


Joined: 22 Jun 2007
Posts: 22
Location: Connecticut

PostPosted: Fri Aug 17, 2007 4:27 pm
Reply with quote

Hey,

Can somebody tell me how to figure out the line number, after i locate a particular text in a program.

Thanks....Rabin
Back to top
View user's profile Send private message
t_ctaram

New User


Joined: 15 May 2007
Posts: 20
Location: mumbai

PostPosted: Fri Aug 17, 2007 5:41 pm
Reply with quote

hi ,

if you are using an EDIT Macro then this code will work

‘ISREDIT (lnum) = LINENUM .ZL’

here lnum will consist the current line number.

Ctaram
Back to top
View user's profile Send private message
t_ctaram

New User


Joined: 15 May 2007
Posts: 20
Location: mumbai

PostPosted: Fri Aug 17, 2007 5:45 pm
Reply with quote

hi,

Cursor can also be used to locate the current position

ADDRESS ISREDIT
"(ROWNUM) = CURSOR"
SAY 'CURRENT ROW_NUM NUMBER IS :' ROWNUM

Ctaram
Back to top
View user's profile Send private message
rabindranathtawker

New User


Joined: 22 Jun 2007
Posts: 22
Location: Connecticut

PostPosted: Fri Aug 17, 2007 7:54 pm
Reply with quote

thanks.. i used the linenum & got the result..
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Using API Gateway from CICS program CICS 0
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top