Login / Register


Share Snipplr


Welcome To Snipplr


Everyone's Recent SAS Snippets



« Prev 1 2
If you want to see this sight unfold right before your very eyes, then our Evening Desert Safari Tour is perfect for you. If you need more information, please do not hesitate to reach us. To make it convenient and accessible for our guests, we have p...
0 75 posted 2 years ago by desertsafaritoure
If a flat file contains embedded carriage return (CR) and linefeed characters (LF) inside double quotes, SAS will interpret them as end of line markers. This may cause your file to be read incorrectly. This example replaces CR/LF characters within...
0 175 posted 6 years ago by webonomic
More details here: https://communities.sas.com/ideas/1084
0 126 posted 6 years ago by webonomic
If you know a libref or fileref, the PATHNAME function can be used to return the physical location. If the libref refers to more than one physical location, all of those locations will be returned, in quotes, separated by spaces, with the whole li...
0 105 posted 6 years ago by webonomic
This sample contains 2 macro techniques for iterating through character values on a macro %DO loop.
0 143 posted 6 years ago by webonomic
Adding alternating row of color to make proc report output easier to read.
0 116 posted 7 years ago by webonomic
If you want to see some of the color names that SAS recognizes, run the following statements, which will print a list of colors to the SAS log:
0 90 posted 7 years ago by webonomic
sas wedit find next and prev
0 67 posted 7 years ago by Pavonz
The program uses the XML LIBNAME engine, FILENAME URL, SGPLOT procedure, and a simple PROC PRINT to create a report of recent Twitter activity around a specified hashtag.
0 103 posted 8 years ago by webonomic
SAS code to output in JSON format
1 69 posted 8 years ago by ccw
This SAS macro will convert a dataset to a text file
0 126 posted 8 years ago by webonomic
It's easy to export several data sets to one Excel spreadsheet with each data set in a separate worksheet.This example exports three SAS data sets (work.region, work.county and work.district) to the same spreadsheet (results.xls).
0 115 posted 9 years ago by webonomic
use bulk load to save a large SAS dataset into oracle/DB2/SQL Server/ Teradata for joining with other tables etc.. Alternate link : http://www2.sas.com/proceedings/sugi29/106-29.pdf
0 78 posted 9 years ago by mprabhuram
The PATHNAME function can be used to retrieve the physical location of a file or directory. This can be especially useful when reassigning engines for a libref using the Macro Language. Here we want to write a Version 6 copy of the data set CLASS...
0 123 posted 10 years ago by webonomic
0 60 posted 11 years ago by statsplank
0 101 posted 11 years ago by webonomic
Use the colon : modifier to build an array. The colon is like a wildcard. In this case, anything that starts with ash. SAS Arrays hold variable names which can be used during tedious procedures such as conditional loops.
0 94 posted 11 years ago by webonomic
Original Source from http://support.sas.com/kb/24/590.html
0 117 posted 11 years ago by webonomic
Annoyingly hard to find, I'm sure others out there have felt the pain of converting sas dates to oracle date formats. example: data _null_; x_dt = datetime(); x_d = date(); put x_dt oracle_datetime.;...
0 85 posted 11 years ago by vasdee
You can use regular expressions within SQL. This can be quite powerful in selecting data that matches certain conditions. The following example shows a simple regular expression which selects only quarterly periods from a table containing years, quar...
0 124 posted 11 years ago by webonomic
0 143 posted 11 years ago by webonomic
0 93 posted 12 years ago by webonomic
Using Proc SQL summarize the table sashelp.shoes grouping on
0 96 posted 12 years ago by webonomic
Below is some code written for creating one response from survey questions where the respondent checks all that apply.
0 93 posted 12 years ago by webonomic
« Prev 1 2