Skip to content

PharmaForest/dataset_maker

Repository files navigation

dataset_maker

The dataset_maker package is intended to consolidate functions related to generating SAS datasets. As its first feature, the ds2datalines macro converts a SAS dataset back into dataset creation code.  

dataset_maker_small  

%ds2datalines() macro

Purpose: Export a SAS dataset into SAS code that recreates the dataset using
ATTRIB + DATALINES. The generated code is written to the output
window (PRINT) and can optionally be copied to the clipboard.

Parameters:

  inlib         Input library name (default: WORK)  
  inds          Input dataset name  (default: CLASS)  
  outlib        Output library name for the generated DATA step (default: WORK)  
  outds         Output dataset name for the generated DATA step  
                (default: same as INDS)  
  dlm           Delimiter character used in DATALINES and PROC EXPORT  
                (default: @)  
  clipbrd_copy  Copy generated code to clipboard (Y/N, default: N)  

Usage Example:

  %ds2datalines(  
    inlib=SASHELP,  
    inds=CLASS,  
    outlib=WORK,  
    outds=CLASS,  
    dlm=@,  
    clipbrd_copy=N  
  );

image  

⇩   

image  


version history

0.1.1(05February2026): Bug Fix 0.1.0(02February2026): Initial version

What is SAS Packages?

The package is built on top of SAS Packages Framework(SPF) developed by Bartosz Jablonski.

For more information about the framework, see SAS Packages Framework.

You can also find more SAS Packages (SASPacs) in the SAS Packages Archive(SASPAC).

How to use SAS Packages? (quick start)

1. Set-up SAS Packages Framework

First, create a directory for your packages and assign a packages fileref to it.

filename packages "\path\to\your\packages";

Secondly, enable the SAS Packages Framework. (If you don't have SAS Packages Framework installed, follow the instruction in SPF documentation to install SAS Packages Framework.)

%include packages(SPFinit.sas)

2. Install SAS package

Install SAS package you want to use with the SPF's %installPackage() macro.

  • For packages located in SAS Packages Archive(SASPAC) run:

    %installPackage(packageName)
  • For packages located in PharmaForest run:

    %installPackage(packageName, mirror=PharmaForest)
  • For packages located at some network location run:

    %installPackage(packageName, sourcePath=https://some/internet/location/for/packages)

    (e.g. %installPackage(ABC, sourcePath=https://github.com/SomeRepo/ABC/raw/main/))

3. Load SAS package

Load SAS package you want to use with the SPF's %loadPackage() macro.

%loadPackage(packageName)

Enjoy!

About

mirror of dataset_maker

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
license.sas

Stars

Watchers

Forks

Packages

No packages published

Languages