Giter Club home page Giter Club logo

sas-macros's Introduction

sas-macros

Selected useful macros from my personal SAS macro library

1. Clone this repository to a local path.
2. Add the local path to your SASAUTOS autocall path.
3. Call the macro by name with ? or !help as the parameter to get syntax help in the log.
For example:
%data2datastep(?)
%data2datastep(!help)

Produces this text in the SAS log:
NOTE: DATA2DATASTEP macro help document:
Purpose: Converts a data set to a SAS DATA step.
Syntax: %DATA2DATASTEP(dsn<,lib,outlib,file,obs,fmt,lbl>)
dsn: Name of the dataset to be converted. Required.
lib: LIBREF of the original dataset. (Optional - if DSN is not fully qualified)
outlib: LIBREF for the output dataset. (Optional - default is WORK)
file: Fully qualified filename for the DATA step code produced. (Optional)
Default is create_&outlib._&dsn._data.sas in the SAS default directory.
obs: Max observations to include the created dataset.
(Optional) Default is MAX (all observations)
fmt: Format the numeric variables in the output dataset like the original data set?
(YES|NO - Optional) Default is YES
lbl: Reproduce column labels in the output dataset?
(YES|NO - Optional) Default is YES

NOTE: DATA2DATASTEP cannot be used in-line - it generates code.
Every FORMAT in the original data must have a corresponding INFORMAT of the same name.
Data set label is automatically re-created.
Only numeric column formats can be re-created, character column formats are ingnored.
Use !HELP to print these notes.

sas-macros's People

Contributors

sasjedi avatar

Forkers

ainakikisagbe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.