Number of records of a subfile in Qdesgin/UNIX?

Daniel Rodríguez reasegurator at gmail.com
Fri Sep 21 04:02:56 CDT 2007


Hi Peter,

Your suggestion about a getsystemval of a OS expression doesn't work (or I
don't know how to do it work) but Bob should take note of it for future
versions of PH.

I've solved my problem (subfile suitable for excel and not empty) with this:

;------------------------------------------------------------
PROCEDURE INTERNAL VALIDAR_SUBFICHERO
BEGIN
 LET TCOMANDO = "$SCRIPTS/comprobar_tamanio.ksh " + TFILE + " 0"
 RUN COMMAND TCOMANDO NOWARN ON ERROR CONTINUE
 IF NOT COMMANDOK ; Greater than 0 --> OK
 THEN
  BEGIN
   LET TCOMANDO = "$SCRIPTS/comprobar_tamanio.ksh " + TFILE + " 65536"
   RUN COMMAND TCOMANDO NOWARN ON ERROR CONTINUE
   IF NOT COMMANDOK ; Greater than 65536 --> NOT OK
   THEN
     ERROR "FILE GREATER THAN 65536"
  END
 ELSE
   ERROR "EMPTY FILE"
END

Where TFILE is the name of the subfile and $SCRIPTS/comprobar_tamanio.ksh is
a Unix shell script that returns an error if the number of records of the
file received as a parameter is greater than the number passed as second
parameter:

wc -l $1 | read TVAR_NUM_REC unwanted
if [ $TVAR_NUM_REC -gt $2 ] ; then
 exit 1
fi


Thank you all,

Daniel Rodriguez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20070921/0dd24933/attachment.htm


More information about the powerh-l mailing list