View previous topic :: View next topic
|
Author |
Message |
arund
New User
Joined: 25 Aug 2005 Posts: 1
|
|
|
|
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 |
|
|
Ravi gaur
New User
Joined: 12 Jul 2005 Posts: 38
|
|
|
|
Arund make it more clear ,,
However Through EXECIO i mostly read records... |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
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 |
|
|
dietocode
New User
Joined: 14 Nov 2005 Posts: 1 Location: Bangalore-India
|
|
|
|
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 |
|
|
sonipankaj
New User
Joined: 23 Nov 2005 Posts: 10
|
|
|
|
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 |
|
|
rabindranathtawker
New User
Joined: 22 Jun 2007 Posts: 22 Location: Connecticut
|
|
|
|
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 |
|
|
t_ctaram
New User
Joined: 15 May 2007 Posts: 20 Location: mumbai
|
|
|
|
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 |
|
|
t_ctaram
New User
Joined: 15 May 2007 Posts: 20 Location: mumbai
|
|
|
|
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 |
|
|
rabindranathtawker
New User
Joined: 22 Jun 2007 Posts: 22 Location: Connecticut
|
|
|
|
thanks.. i used the linenum & got the result.. |
|
Back to top |
|
|
|