Computing.Net > Forums > OpenVMS > reading a line with DCL

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

reading a line with DCL

Reply to Message Icon

Name: Asaf Karagila
Date: March 18, 2005 at 07:48:15 Pacific
OS: OpenVMS 6.2
CPU/Ram: AlphaServer 800/512Mb SDR
Comment:

Hi,
how can i read a specific line from a file,
without reading everything before it ?

my problem is that i have no compiler to use, only DCL.

thanks,
- Asaf.



Sponsored Link
Ads by Google

Response Number 1
Name: Bob Gezelter
Date: March 20, 2005 at 00:01:45 Pacific
Reply:

Asaf,

If the file is indexed, you can use the DCL READ command to access it by key.

Otherwise, there is no direct way to read the nth record in a sequential file (that is not a DCL restriction, it is a more general restriction of variable length sequential text files).

If you are looking for a record containing a particular string, you can use the SEARCH command to locate it, then process the output of SEARCH.

If you have no compiliers, you DO have the MACRO-32 compiler, which can be used (ok, it is assembler, but I want people to remember that it is included). Also, you can download JAVA and the various **IX tools, such as PERL at no charge from http://www.hp.com/go/openvms.

I hope that this is helpful.

- Bob Gezelter, http://www.rlgsc.com


0

Response Number 2
Name: Asaf Karagila
Date: March 21, 2005 at 11:06:30 Pacific
Reply:

well, the file is a text file..
i don't think it's indexed or anything.

what is the MACRO-32 ? i never came across that on the OpenVMS, but that might be removed because it is a military computer,
which makes it unaccessible to internet as well.
so that takes out the java and perl etc.

i've got an idea though.
tomorrow i'll give it a try and see if i can make it work.

the entire idea is to just take out a block from a text file,
from an unknown location within the file.
is to locate the certain parameter i'm looking for,
and then take the 5-6 lines previous to it.

now comes the problem i had,
i couldn't go back in the file after a READ,
otherwise i'd just go to selected lines,
what i intend to try is to output the SEA with line numbers into a file,
get the line number, and read empty buffers until like, 10 lines before the line number,
then to extract the 10 lines i need.

isn't that something.

considering the tools i work with,
i'm doing some really good things..

- Asaf.


0

Response Number 3
Name: erensm
Date: March 21, 2005 at 14:15:29 Pacific
Reply:

Do you know the /WINDOW= qualifier of SEARCH ?


0

Response Number 4
Name: Asaf Karagila
Date: March 21, 2005 at 20:31:05 Pacific
Reply:

yes, i am aware of that. but i need it to be automated.
otherwise i would've searched it with EDT or something like that..


0

Response Number 5
Name: Asaf Karagila
Date: March 25, 2005 at 00:25:34 Pacific
Reply:

Well, it works.
I used "sea /num/out=temp.tmp Myfile"
and read the line numbers, decreased 20 of the number, buffered the lines until the location i want,
and outputed to another file the 20 lines i needed.

it's working perfectly. although i'd enjoy a F$SEEK(file handle,line number) infused in DCL...


0

Related Posts

See More



Response Number 6
Name: venmala
Date: August 1, 2007 at 22:43:10 Pacific
Reply:

Hi ,

Can you please explain the process in detail of retrieving some particular lines as this seems to similar to my requirement.I need to cross-check the files in VMS and the same file downloaded into windows by retrieving lines with a sort of search criteria

DV


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to OpenVMS Forum Home


Sponsored links

Ads by Google


Results for: reading a line with DCL

editing a txt file using a com file www.computing.net/answers/openvms/editing-a-txt-file-using-a-com-file/518.html

Creating a queue www.computing.net/answers/openvms/creating-a-queue/319.html

Open File www.computing.net/answers/openvms/open-file/551.html