Tuesday, December 14, 2010

Producing a Row Number using Proc SQL

This is an undocumented feature of SAS, where in we can achieve a feature similiar to the _N_ of the Data step using the Proc SQL

PROC SQL;
SELECT MONOTONIC() AS Row_Number FORMAT=COMMA6.,
ITEM,
UNITS,
UNITCOST FROM PURCHASES;
QUIT;

/* 2.3.4.11 Code Example: Producing a Row Number with the NUMBER Option */
PROC SQL NUMBER;
SELECT ITEM,
UNITS,
UNITCOST
FROM PURCHASES;
QUIT;

Wednesday, December 1, 2010

5 Ways to Secure your Passwords in SAS

I always wondered if there is a better way to secure a password in a SAS Program other than the Proc Pwencode procedure which Encrtyps the password in the program, However any user though not knowing your password can actually run your program and obtain the results, all that the Proc Pwencode does is to protect your password from others looking over your shoulder.

Off late I came across a SAS Blog that gives us 5 ways to secure/eliminate the password(Including the Pwencode), Quiet Interesting Ain't it??

http://blogs.sas.com/sasdummy/index.php?/archives/222-Five-strategies-to-eliminate-passwords-from-your-SAS-programs.html

Tuesday, November 30, 2010

Group member cannot see shared group content in SAS Information Delivery Portal

A documented glitch from the SAS Docs, A portal Admin/ Content Admin cannot share the pages in the portal.

http://support.sas.com/kb/36/697.html

Proc SQL Feedback Option

The Feedback option in Proc SQL, puts the expanded or Transformed verion of the query to the log window, this can be quiet handy and can be compared to the Macro debugging options.

Here is an example :
Program:
proc sql feedback;
select * from temp
group by post having count( distinct code ) ge 2 ;
quit;

Here is the log:
proc sql feedback;
16 select * from temp
17 group by post having count( distinct code ) ge 2 ;
NOTE: Statement transforms to:
select TEMP.post, TEMP.code
from WORK.TEMP
group by TEMP.post
having COUNT(distinct TEMP.code) >= 2;

REPLAY SAS Stored Process

Hi,
Came across yet an other interesting SAS Document that may be useful for REPLAYing css and Javascript files, I will publish my version of this soon.

http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/embedgrf.html

Monday, November 29, 2010

Running a SAS Stored Process in Background mode

Here is a Tip from the SAS Tech. support which might be useful for Increasing the Stored Process performance.
http://support.sas.com/kb/39/114.html