LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 26 Jun 2000 15:06:08 -0400
Reply-To:     PBourdages@IAG.QC.CA
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Patrice Bourdages <PBourdages@IAG.QC.CA>
Subject:      Re: How long a SAS program took to run
Comments: To: wendy.watson@COVANCE.COM
Content-Type: multipart/alternative;

Here's a macro (in french) that will create a table called perm.maj_mens. It will keep track of whatever step you would like to check. It might be every data step, every block of a program, every program or whatever. It uses another macro (provided below) that will check if a table already exist in a lib otherwise it will create it.

If you're very interested, I'll take some time to "translate" everything into english. Basically here's how it works.

Install those two macro in your macro library (LIBRARY probably).

Modify your program to show the following (the %tag lines):

%tag(Start Of My Big Process); %tag(My Whatever Data Step); data whatever; set perm.something; x = (b/4)*100; run;

%tag(My Whatever Sort); proc sort data=work.whatever; by x; run; %tag(End of my Big Process);

All the %tag lines are there to create an observation in a table called perm.maj_mens. After the program as run, you could have a program that run an analysis of the contents of this table. Again, if interested, I could send you the one I use on a monthly basis.

For this particular process, you'll need the following macro variable instanciated before:

%let periode = 9905;

The table perm.maj_mens will contain the following observation:

ETAPE Periode Jour Heure Start Of My Big Process 9905 1999-06-03 10:00:00 My Whatever Data Step 9905 1999-06-03 10:00:01 My Whatever Sort 9905 1999-06-03 15:01:56 End of my Big Process 9905 1999-06-03 16:23:08

Hope this helps a little...

Sincerely yours,

Patrice Bourdages :-) IS Analyst Quebec, QC, Canada

***************************[ cut here ]************************************************* %macro tag( etape ); %local optnotes; %let optnotes = %sysfunc(getoption(notes)); options nonotes;

%* Inscrition de la date et de heure dans un fichier temporaire; data work._temp_; length etape $60. periode 4.; periode = "&Periode"; etape = "&etape"; jour = date(); heure = time(); format heure hhmm10.2 jour yymmdd10.; run;

%* Verifie existance du fichier receptif final; %verifich(lib=PERM, fichier=MAJ_MENS); %put &fexiste;

%* Si existe pas, le creer en copiant le fichier temporaire; %if "&fexiste" = "Non" %then %do; data perm.maj_mens; set work._temp_; run; %end;

%* Si existe, ajouter les donnees du fichier temporaire.; %if "&fexiste" = "Oui" %then %do; proc datasets lib=PERM mt=data nolist; append base=maj_mens data=work._temp_; quit; %end;

%* Si étape appelle Final, on flush le fichier temporaire; %if "&etape" = "Final" %then %do; proc datasets lib=work mt=data nolist; delete _temp_; quit; %end; options &optnotes; %mend tag;

%macro verifich(lib=, fichier=); %global fexiste; %local _lib; %local _fichier;

%let fexiste = Non; %if &fichier= %then %do; %put; %put *** Erreur: Fournir un nom de fichier; %put; %end; %else %do; options nonotes; data _null_; set sashelp.vstabvw; %if &lib= %then %do; where memname eq "&fichier"; %end; %else %do; where libname eq "&lib" and memname eq "&fichier"; %end; if _n_>= 1 then call symput("FEXISTE","Oui"); run; options notes; %end; %mend verifich;

***************************[ cut here ]*************************************************

-----Message d'origine----- De : wendy.watson@COVANCE.COM [mailto:wendy.watson@COVANCE.COM] Envoyé : 26 juin, 2000 12:13 À : SAS-L@LISTSERV.UGA.EDU Objet : How long a SAS program took to run

Does anyone have SAS code that will record how long a program took to run (in hours -- using DATE and TIME) and reports the information in the log?

Thanks, -Wendy


[text/html]


Back to: Top of message | Previous page | Main SAS-L page