Suggest some self-initiated desk-checking for SAS performance, which many times is data-dependent and application-dependent.
For example, using SUBSTR with lead-character test, such as the statement construct IF SUBSTR( ,1,..) is much more expensive with iterating a million times than just using the coding technique IF =: instead. And, not so much a concern, when iterating a DATA step execution only a few times.
You can setup a "test scenario" DO / END loop, as demonstrated below to explore cause/effect with various data-scenarios and coding constructs:
OPTIONS FULLSTIMER;
* SAMPLE DATA STEP TO TEST OPER PERFORMANCE FOR SUBSTR. ;
DATA _NULL_;
RETAIN A 'XXX';
DO I=1 TO 1E6;
IF SUBSTR(A,1,1) = 'Y' THEN ;
* IF A =: 'Y' THEN ;
END;
RUN;
Also, for testing code-path for desired / expected results, suggest using the PUTLOG ">DIAG-nn>" / _ALL_; statement, when used tactically to detect SAS variable value conditions at desired points in a DATA step process/flow -- the use of "nn" helps identify each unique processing point, when there are more than one PUTLOG statements being used.
Scott Barry
SBBWorks, Inc.
Suggested Google advanced search arguments, this topic / post:
code performance considerations site:sas.com
debugging techniques site:sas.com
... View more