My name is Jared.  I'm a SAS and web programmer, internet and tech junkie, computer geek, and Linux fanatic.

Search SAS Blog
Connect with me
@jprins on Twitter
Ads

Jared's SAS Blog

All about SAS and SAS programming...

Monday
Nov142011

Convert SAS dataset to text file

This SAS macro will convert a dataset to a text file.

libname BC "C:\file\path";
%macro filecreate;
    %do x=1 %to 700;
    filename lb18 "C:\folder\lb&x..txt" LRECL=8006;
    data _null_;
          set BC.some_data (firstobs=&x obs=&x);
          file lb18 dsd dlm='09'x;
          put var1;
    run;
    %end;
%mend;
%filecreate;

View this code on snipplr.

 

Wednesday
Nov092011

Brush up on your SAS Operators

It's always good to brush up on your SAS operators: http://blogs.sas.com/content/sastraining/2011/09/08/a-quick-tour-of-sas-operators/

The only challenge I had was where the heck on the keyboard do you get " ¬ "?

I never knew this, but it's call a NOT SIGN.  It has the Unicode Character is U+00AC.   It's ALT code is 0172. You can type characters using keyboard by holding down the ALT key while typing in the number code on the number pad of your keyboard, then letting go of ALT.  Neat! 

 

Tuesday
Nov082011

SAS Enterprise Miner needs friendlier error messages

I booted my SAS Text Miner computer and proceeded to launch SAS Enterprise Miner. After setting up my project, I was greeted with this funky error message:
org.omg.CORBA.UNKNOWN:  Indeterminate POSAPPLY() failure on server from 
server method newObject.  vmcis:  0x0 mine codes: 0 completed: No
Thank goodness for the SAS Knowledge Base. It reports this error as having an expired license. Now why couldn't the error just say that? Even better, why let me go through the trouble of starting to make a new project in the first place? Shouldn't the error come up right away?
Anyway, friendly error messages are always welcome.
Monday
Nov072011

SAS Poetry Inspriration

Chris Hemedinger shared with us some SAS Poetry.  He's made a call out for anyone inspired to write their own and share.  

Thanks to Len's witty "data good looking model", I was inspired with this little ditty below.  It uses all the ten most occuring words in the SAS documentation corpus.

 

MODELs should VALUE their OPTIONs 
to DATA SAS programmer often
because we're VARI-ABLE 
to SET nicely a TABLE 
while PROCessing their STATEMENTs, not block them.