BookmarkSubscribeRSS Feed

Add a DESC= to allow user-coded description value to as many "proc-level" (i.e. DATA step, PROC xxxxx, possibly ODS ) statements as possible.   Add an option to add this descriptor to some SASLOG messages such as at the end of DATA or PROC when showing CPU use.

z/OS specific, add this value to the SAS SMF record.

The intent is to allow "grouping" of pieces of a program, to easier identify the parts that error messages come from, or analysis of resources used,  with a value of meaning to the user. Such as "summarization and redistribution of sales by region"  which might consist of many different DATA and PROC actions but be one logical piece to the user.

11 Comments
Reeza
Super User

Wouldn't comments or PUT statements accomplish this task?

ballardw
Super User

Is this intended to provide "groups" for non-contiguous code? Because I am having a hard time visualizing what you may get if the code isn't contiguous.

 

Or does this have something to do with macros as the default behavior of macro generated code doesn't provide an automatic description of which macro was running when looking at the log?

 

I have in some jobs that had many macros or complex interactions of macro added:

 

%put Starting Macro: ThisMacroName with parameters:  <parameter list>;

<all the actual macro code>

%put Ending Macro ThisMacroName;

 

You can add WARNING: , ERROR: or NOTE:  to the beginning of the phrase to get color highlights in the Log.

TimH
Quartz | Level 8

Comments and put statements work for reviewing the code or the SAS log,  but  would _not_ externalize the grouping to the SMF record or other logging record used for measuring SAS utilization.  I am, admittedly, primarily a mainframe user of SAS so SMF is important.  

TimH
Quartz | Level 8

This has nothing to do with macros or 'non-contiguous' code -  it's just a text descriptor, my primary focus (as stated above) is to get it externalized to logs where analysis of a big SAS program's use of resources.  For example, I have a program that uses 6 minutes of CPU time.  I'd like to be able to analyze the SAS SMF records and see not just 'PROC REPORT' but that it was specifically the 'PROC REPORT' for 'SUMMARY BY GROCERY BAGGER NAME'  that used the CPU.

PhilC
Rhodochrosite | Level 12

Give examples.

TimH
Quartz | Level 8

/* example of what I'm talking about syntax not checked and dumb code purely for exampl */

DATA Eastern (KEEP=Store Sales WHERE=(Region='Eastern')) / DESC='Summarizing eastern region'; SET AllStores;

PROC SORT DATA=Eastern DESC='Summarizing eastern region'; BY Store;

PROC MEANS DATA=Eastern NOPRINT DESC='Summarizing eastern region';

     CLASS Store;

    VAR Sales;

     OUTPUT Out=SumEast

                    Sum=Sales;

DATA Western (KEEP=Store Sales WHERE=(Region='Western')) / DESC='Summarizing western region'; SET AllStores;

PROC SORT DATA=Western DESC='Summarizing western region'; BY Store;

PROC MEANS DATA=Western NOPRINT DESC='Summarizing western region';

     CLASS Store;

    VAR Sales;

     OUTPUT Out=SumWest

                    Sum=Sales;

===============================
SO - in the SMF records, not only would we have the JOB name, the STEP, and the records that say "DATA step" or the procedure name, we'd have an identifier that would tell us what 'group' of code.   I don't know if other platforms have ways of logging resource use by SAS programs but if they do, then this would be helpful there as well.  This information would help immensely when trying to improve the performance of production SAS code.

sbb
Lapis Lazuli | Level 10
Lapis Lazuli | Level 10

Take it bit further, please (for all OS platforms) -- while executing/defined, also populate an AUTOMATIC variable (with the user-declared DESC="<your_useful_description_goes_here>")  which can be interrogated (for example in a common SAS macro) for the purpose of conditional execution code-path.  I do this today with the executing USERID, allowing conditional SAS logic execution at session start-up.

Scott Barry
SBBWorks, Inc.

Giuseppegiacomo
Calcite | Level 5

I agree with the proposal

PhilC
Rhodochrosite | Level 12

I wonder if this could be made a function of PROC PRINTTO.   (not OUTPUT)

PhilC
Rhodochrosite | Level 12

So would this produce output to a log similar to what you are proposing:

%LET DESC=Merge all files;
%PUT NOTE: BEGIN:&DESC;

DATA foobar;  merge S N A F U;
  ...
RUN;

%PUT NOTE: END:&DESC;

...just without macro commands?