Hi everyone, I wrote some code for sas DI where I get the start and end time of the job.
Does anyone know how to get a number, how many row was inserted?
%global startTm endTm;
%macro startTiming();
%let startTm = %sysfunc(datetime());
%mend startTiming;
%macro endTiming(entry=);
%let endTm = %sysfunc(datetime());
proc sql;
insert into lib.Tab
values("&Entry", &startTm, &endTm );
quit;
%mend;
%startTiming();
CODE OF JOB
%endTiming(entry=Tab);
If you have access to SAS Environment Manager, I think this information would be available if you activate performance logging:
https://documentation.sas.com/doc/en/etlug/4.903/p1xs37ux2hnk80n1h9bdj5gnswcn.htm
DI Studio has the macto variable etls_recnt avaible, but that only shows the no of records in the target table after the update, not no of records added/updated. I guess that you could have a pre-code to get the no of records before the the loader, and then calculate at the end no of records inserted?
Unfortunately I don"t have access to SAS Environment Manager.
I think I could get a pre-code to get the no. of records before the loader and then calculate at the end no. of records inserted - as you say
Can you tell me how to get it?
I would like to enter the data that I have into the table where I have the start and end time.
sasinnovate.png
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just 495ドル!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.