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.
I haven't tried this, but if you add
%put &sqlobs;
after your PROC SQL, it should display the number of observations (rows).
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.