Nothing built in, but here is a simple function to do it:
FUNCTION CountFile(FileName)
$INCLUDE UNIVERSE.INCLUDE ODBC.H
SQL = 'SELECT COUNT(*) FROM ':FileName
Counter = 0
Ok = SQLExecDirect(@HSTMT,SQL)
Ok = SQLBindCol(@HSTMT, 1, SQL.B.DEFAULT, Counter)
Ok = SQLFetch(@HSTMT)
Ok = SQLFreeStmt(@HSTMT, SQL.DROP)
RETURN(Counter)
Usage:
DEFFUN CountFile(fn)
Crt CountFile('VOC')
Brian
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of T Stokes
> Sent: 18 November 2008 22:59
> To: [email protected]
> Subject: [U2] Counting records
>
> I am trying to remember a Universe function that returns the
> number of records in a file.
> Something like this.
>
> OPEN 'SOMEFILE' TO SOMEFILE ELSE STOP 201,"SOMEFILE"
>
> NUM.OF.RECORDS = UNKNOWNFUNCTION(SOMEFILE)
> --
> View this message in context:
> http://www.nabble.com/Counting-records-tp20569376p20569376.html
> Sent from the U2 - Users mailing list archive at Nabble.com.
> -------
> 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/