Dear Sir,
In a batch, How to count total of records in a file.
Thanks
Total cases
-
- Posts: 1796
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Total cases
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));
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));