Profile
Achievement
 
    
                webonomic's Recent Snippets
- All /
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 
        
        
            4734 
        
                    posted 11 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 
        
        
            3514 
        
                    posted 12 years ago by webonomic
            This sample contains 2 macro techniques for iterating through character values on a macro %DO loop.
        
        
        
            0 
        
        
            3783 
        
                    posted 12 years ago by webonomic
            Adding alternating row of color to make proc report output easier to read.
        
        
        
            0 
        
        
            1782 
        
                    posted 12 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 
        
        
            3267 
        
                    posted 13 years ago by webonomic
            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 
        
        
            1455 
        
                    posted 13 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 
        
        
            3637 
        
                    posted 14 years ago by webonomic
            This regular expression used in Ruby will extract the characters between single or multi-character delimiters.  It helps when you have strange delimiters such as \":delimeter1: text I want to grab goes here :delimiter2:\"
        
        
        
            0 
        
        
            1395 
        
                    posted 15 years ago by webonomic
            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 
        
        
            3709 
        
                    posted 15 years ago by webonomic
            This command will email the contents of emailbody.txt to [email protected] with the subject My subject line.
        
        
        
            0 
        
        
            1527 
        
                    posted 15 years ago by webonomic
            This creates an array of various linux shell names, loops through the array and ouputs a file called shell_locations.txt showing where the shells are located on the linux system.
        
        
        
            0 
        
        
            1507 
        
                    posted 15 years ago by webonomic
            About the dd command:
dd if=<source> of=<target> bs=<byte>("USUALLY" some power of 2, not less than 512 bytes(ie, 512, 1024, 2048, 4096, 8192, 16384[/b], but can be ANY reasonable number.) skip= seek= conv=<conversion>.
Source is the data being...
        
        
        
            0 
        
        
            1163 
        
                    posted 16 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 
        
        
            3417 
        
                    posted 16 years ago by webonomic
            Bash shell scripts to control wallpaper backgrounds when switching between Ubuntu workspaces. (Other distributions can use it too).
Take the below 2 scripts to make 2 separate files.  Use gconf-editor to attach keybindings to run_command_1 and run...
        
        
        
            0 
        
        
            1314 
        
                    posted 16 years ago by webonomic
            If you don't have Adobe Acrobat Pro to export a PDF to multiple images, you can use this ImageMagick code.
This command will produce the files 'result-0.jpg' , 'result-1.jpg', etc... for each PDF page.
        
        
        
            5 
        
        
            1936 
        
                    posted 16 years ago by webonomic
            You can use this code in Bash or Windows CMD / Command prompt (although you'll have the change the comment character from # to :: for the windows prompt)
        
        
        
            1 
        
        
            1962 
        
                    posted 16 years ago by webonomic
            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 
        
        
            3570 
        
                    posted 17 years ago by webonomic
            Using Proc SQL summarize the table sashelp.shoes grouping on
        
        
        
            0 
        
        
            3336 
        
                    posted 17 years ago by webonomic
            Below is some code written for creating one response from survey questions where the respondent checks all that apply.
        
        
        
            0 
        
        
            3466 
        
                    posted 17 years ago by webonomic