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.
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..
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...
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
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE