Here is a sample routine that works with DS/Solaris/Unix
*************************************************************
** Routine: GetFileNbRows
** Creator: Youssef Loudiyi
** Company: BI Expertise -
www.biexpertise.com
*************************************************************
**** Get the line count for .upd files in the Load folder
*Prepare and execute the count
UnixStmt = "wc -l ":FullFileName:" | awk '{print $1}' $1"
Call DSExecute('UNIX',UnixStmt,StdOut, ReturnValue)
*Check if the sentence "Cannot open" is found in the Standard Output, if so, there was no file in the folder.
IF INDEX(OConv(StdOut,"MCL"),"cannot open",1) THEN
Ans = 0
END
ELSE
IF ReturnValue = 0 then
Ans = Left(StdOut,Len(StdOut)-1)
END
ELSE
Call DSLogFatal("Error while trying to execute the 'wc -l' unix command on ":FullFileName, "IDWLineCounter")
END
END
*************************************************************