Secure File Transfer Protocol has become the standard for transferring files outside our organization. However, it is not always the easiest thing to do in SAS. Here are a few code examples for you to steal. Importing a CSV file over SFTP: %let host=afhood.com; %let sftpOption=-o IdentityFile=/home/user/.ssh/id_rsa; %let filename=theFile.csv; %let sftpPath=/home/remoteuser/dir/; filename myfile sftp...
Read more »
Tags: SAS, SAS Code, sftp
Posted in SAS | Comments Off
If you run a production SAS environment or even a development environment for that matter, it is nice to have a specific location for all logs to be written and managed. ALTLOG helps achieve this. The ALTLOG option can be set numerous ways, but we typically utilize 2. 1. As an option on the...
Read more »
Tags: afhood group, alternative log, altlog, analytics, analytics consulting, command line, consulting, log directory, log management, SAS, sas administrator, SAS Code, SAS log
Posted in SAS | Comments Off
One of the issues with SAS for many IT departments is the lack of integration with service oriented architecture (SOA). The good news is with many new features coming online with versions 9.X+ are service oriented. Lets look quickly at the Proc SOAP procedure now available. For those SAS programmers out there that aren't familiar...
Read more »
Tags: AAG, AFHood Analytics Group, analytics consulting, consulting, dynamic, function, General Chatter, http post, output to file, proc soap, SAS, SAS Code, SOA, web service, webservices, XML
Posted in SAS | Comments Off
We write a LOT of SQL here and although SQL is a powerful database language, it can be tedious. So here is one tip for shortening all that typing. Typical join sytax: select some_columns from one_table join another_table on one_table.column_1 = another_table.column_1 and one_table.column_2=another_table.column_2 where some_column > someother_column ; Not too bad, right? In order...
Read more »
Tags: AAG, AFHood Analytics Group, analytics, coding tip, databases, DB2, dbms, Oracle, SAS, SAS Code, sql, sql tip, teradata, tips, USING clause, using function
Posted in SAS | Comments Off
Fastexport is the fastest way to get large data out of teradata. Fastexport utilizes multiple connections to deliver data and therefore speeding up the transfer of data between Teradata and SAS. Here are a few examples of fastexport. /* libname statement*/ libname teradb teradata username=&un password=&pw dbsliceparm=all; /* explicit sql */ proc sql; connect...
Read more »
Tags: AAG, AFHood Analytics Group, analytics, analytics consulting, conditional processing, databases, dbms, dbslice, dbsliceparm, fastexport, SAS, SAS Code, SAS log, teradata
Posted in SAS | Comments Off
NOTE: This is a great one we picked up from our friends over at the SAS community. We have run across this literally hundreds of times while programming SAS macros. You need to have a default value for a variable and you don’t want to write another macro to set it if it doesn’t...
Read more »
Tags: AAG, AFHood Analytics Group, conditional processing, conditional programming, default value, dynamic, function, if then, macro coding, macro script, open code, SAS, sas automation, SAS Code, SAS macro, SAS Macros, sas script, string functions
Posted in SAS | Comments Off
Ever heard of ‘where also’? Neither did we.
We have to give credit to the guys at the SAS Community.
‘Where also’ allows you to add a series of where statements. The use acts like a single where statement with the and condition....
Read more »
Tags: AAG, AFHood Analytics Group, analytics, analytics consulting, conditional processing, conditional programming, dynamic, function, SAS, SAS Code, where, where also, where statement
Posted in SAS | Comments Off
SymputX is the upgrade from Call Symput. Syntax: call symputx(“macro_var_name”, character_value (or numeric to be converted to char), symbol table def); Where symput will produce a note about converting character values to numeric, symputx won’t produce such a note. Additionally it will strip leading and trailing spaces form the character value. Lastly, you can...
Read more »
Tags: AAG, AFHood Analytics Group, call routines, call symput, call symputx, conditional programming, macro variables, numeric type, SAS, SAS Code, SAS macro, symputx, variable types
Posted in SAS | Comments Off