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.
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.
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)
%ds2datalines(
inlib=SASHELP,
inds=CLASS,
outlib=WORK,
outds=CLASS,
dlm=@,
clipbrd_copy=N
);⇩
0.1.1(05February2026): Bug Fix 0.1.0(02February2026): Initial version
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).
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)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/))
Load SAS package you want to use with the SPF's %loadPackage() macro.
%loadPackage(packageName)

