Login / Register


Share Snipplr


Welcome To Snipplr


Everyone's Recent SAS Snippets



« Prev 1 2
  1. FAV

    Evening Desert Safari

    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...
    SAS 3 views posted 2 years ago by desertsafaritoure
  2. FAV

    Remove carriage return and linefeed characters within quoted strings

    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...
    SAS 5 views posted 6 years ago by webonomic
  3. FAV

    Allow a list of non-numeric values for an iterative macro %DO loop

    More details here: https://communities.sas.com/ideas/1084
    SAS 6 views posted 6 years ago by webonomic
  4. FAV

    Using PATHNAME to Retrieve a Physical Path

    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...
    SAS 4 views posted 6 years ago by webonomic
  5. FAV

    Using character values on a macro %DO loop

    This sample contains 2 macro techniques for iterating through character values on a macro %DO loop.
    SAS 10 views posted 6 years ago by webonomic
  6. FAV

    Using Alternating Background Color with PROC REPORT

    Adding alternating row of color to make proc report output easier to read.
    SAS 4 views posted 7 years ago by webonomic
  7. FAV

    Specify colors in SAS statistical graphics procedures

    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:
    SAS 4 views posted 7 years ago by webonomic
  8. FAV

    sas wedit find next and prev

    sas wedit find next and prev
    SAS 4 views posted 7 years ago by Pavonz
  9. FAV

    Creating a report of Twitter hashtag activity

    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.
    SAS 11 views posted 7 years ago by webonomic
  10. FAV

    [SAS] JSON output

    SAS code to output in JSON format
    SAS saved by 1 person 6 views posted 7 years ago by ccw
  11. FAV

    Convert SAS dataset to Text file

    This SAS macro will convert a dataset to a text file
    SAS 9 views posted 8 years ago by webonomic
  12. FAV

    Exporting Multiple Data Sets to One Spreadsheet

    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).
    SAS 3 views posted 8 years ago by webonomic
  13. FAV

    SAS Oracle Bulk Load

    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
    SAS 5 views posted 9 years ago by mprabhuram
  14. FAV

    SAS Macro to FTP files between PC and Unix or among Unix server Locations...

    SAS 5 views posted 9 years ago by sastechies
  15. FAV

    SAS Macros to Search and Report Errors and Warnings from your SAS Logs

    SAS 3 views posted 9 years ago by sastechies
  16. FAV

    SAS Macros to Read data from MS Excel using DDE

    SAS 1 views posted 9 years ago by sastechies
  17. FAV

    Retrieve the physical location of a dynamic dataset, file or folder in SAS

    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...
    SAS 6 views posted 10 years ago by webonomic
  18. FAV

    SAS Macro to create a delimited text /csv file from a SAS data set..

    SAS 5 views posted 10 years ago by sastechies
  19. FAV

    find the nth business day of a given month and year in SAS

    SAS 7 views posted 10 years ago by sastechies
  20. FAV

    Selecting 5 max observations per category

    SAS 2 views posted 10 years ago by statsplank
  21. FAV

    Import from and Export to Excel

    SAS 4 views posted 10 years ago by statsplank
  22. FAV

    Create Access Database from SAS

    SAS 4 views posted 11 years ago by webonomic
  23. FAV

    SAS Array Colon Modifier

    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.
    SAS 3 views posted 11 years ago by webonomic
  24. FAV

    Convert values from character to numeric or from numeric to character

    Original Source from http://support.sas.com/kb/24/590.html
    SAS 2 views posted 11 years ago by webonomic
  25. FAV

    Converting SAS datetime to oracle_datetime

    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.;...
    SAS 2 views posted 11 years ago by vasdee
  26. FAV

    Use Regular Expressions in Proc SQL

    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...
    SAS 3 views posted 11 years ago by webonomic
  27. FAV

    Access SQLite Database from SAS

    SAS 5 views posted 11 years ago by webonomic
  28. FAV

    Match Merge using Proc SQL

    SAS 6 views posted 11 years ago by webonomic
  29. FAV

    Using Proc SQL to summarize tables into groupings

    Using Proc SQL summarize the table sashelp.shoes grouping on
    SAS 2 views posted 11 years ago by webonomic
  30. FAV

    Create one response from "check all that apply" variables

    Below is some code written for creating one response from survey questions where the respondent checks all that apply.
    SAS 5 views posted 11 years ago by webonomic
« Prev 1 2