0

I want each daily report only show documents that were scanned after the last report was run. I don't want the report to be a running total of all previous documents.

PROC SQL;
CREATE TABLE ARG_REPORT
 AS SELECT
   VID,
   LAST_NAME,
   FIRST_NAME,
   MI
FROM WORK.FINAL_RESULTS2;QUIT;

ARG_REPORT is the output, but gives all variables in the data. Need only today's scanned data. What can I do? Thanks!

user3489870
  • 95
  • 1
  • 2
  • 8

3 Answers3

0

Do you have a column for the date of the report or scan? If so, I believe you could do something like:

BEGIN
CREATE TABLE ARG_REPORT
 AS SELECT
   VID,
   LAST_NAME,
   FIRST_NAME,
   MI
FROM WORK.FINAL_RESULTS2
WHERE REPORT_DATE >= GETDATE();
END
daniness
  • 363
  • 1
  • 4
  • 21
  • No I don't have the date and I think no need it. I need only today's scanned data. We can create a date maybe, don't know how to do. thanks – user3489870 May 29 '14 at 15:39
0

You need to store the data that was already reported on in some fashion. You could store it in a table (you could have a 'running total' report table that was indeed the running total, and when you generate your report get only new records by joining to that table).

If the VID field is something that you could use as a limit (select only VIDs that are larger than the largest VID in the previous report) then you could store that in a table (or in a macro variable - for example, if the last report is available to input, you could read it in, read the largest VID into a macro variable via call symput, and then limit your query that way).

Joe
  • 62,789
  • 6
  • 49
  • 67
0

My reports shows like

             PROC EXPORT DATA= WORK.ARG_REPORT
        OUTFILE= "/dwdata/sas_data/ARG_REPORT_&numdate..csv" REPLACE;run;

Is there any way that I can compare the results with one day before. ARG_REPORT_&numdate-1, something like this. ?

user3489870
  • 95
  • 1
  • 2
  • 8