Page 1 of 1

Total cases

Posted: May 26th, 2014, 4:30 pm
by robcar
Dear Sir,
In a batch, How to count total of records in a file.

Thanks

Re: Total cases

Posted: May 28th, 2014, 2:41 pm
by Gregory Martin
The listing file that is shown after a batch application runs displays the number of cases and records. If you need that information in logic, you might consider writing code like this:
PROC GLOBAL

numeric caseCounter;
numeric recordCounter;


PROC APPLICATION_FF

    
errmsg("There were %d cases and %d records in the data file.",caseCounter,recordCounter);


PROC QUEST

    
inc(caseCounter);
    
    
inc(recordCounter,count(REC1)); // instead of REC1, REC2, ...
    inc(recordCounter,count(REC2)); // use the names of the records in your dictionary
    inc(recordCounter,count(REC3));
    
inc(recordCounter,count(REC4));
    

Re: Total cases

Posted: May 29th, 2014, 8:03 pm
by robcar
Thanks Greg.