James,

Without knowing why you don't want to loop through it, these may or may not
be helpful:

1. OpenSeq the file, get the size of it from a Status statement and ReadBlk
the entire file in one go, depending on size of course. Then you can DCount.

2.  Ditto, but loop through - not a line at a time but using ReadBlk with a
reasonable block size, counting delimiters as you go.

3. Shell a 'wc -l' on the file and capture the output.

Brian

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: 21 June 2005 20:38
> To: [email protected]
> Subject: [U2] Field Count from a Seq File
> 
> I hope someone can show me an easy way to get the number of 
> lines from a sequential file - without looping through the file.
> 
> I am running UV 10.x on a AIX box.
> 
> I open the file using an OPENSEQ command and I am looping 
> through the record using a READSEQ  command.
> 
> Either immediately after the OPENSEQ or after the first 
> READSEQ, I would like to know if there is more then 1 line in 
> the file.
> 
> I know that prior to doing the OPENSEQ, I could open the 
> file, read the record and then DCOUNT(RECORD,@FM) to get the 
> number of fields, close the file and then do a sequential 
> open and read.  I am hoping that there is a system variable 
> or something that I can use after the OPENSEQ.  Looping 
> through the record is not a viable option.
> 
> Thanks
> 
> Jim
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to