Total cases

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
robcar
Posts: 8
Joined: May 26th, 2014, 4:26 pm

Total cases

Post by robcar »

Dear Sir,
In a batch, How to count total of records in a file.

Thanks
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Total cases

Post 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));
    
robcar
Posts: 8
Joined: May 26th, 2014, 4:26 pm

Re: Total cases

Post by robcar »

Thanks Greg.
Post Reply