Production Ready Macros for SAS Application Developers
mp_ds2cards.sas File Reference

Create a CARDS file from a SAS dataset. More...

Go to the source code of this file.

Detailed Description

Uses dataset attributes to convert all data into datalines. Running the generated file will rebuild the original dataset. usage:

%mp_ds2cards(base_ds=sashelp.class
  , cards_file= "C:\temp\class.sas"
  , maxobs=5)

stuff to add

  • labelling the dataset
  • explicity setting a unix LF
  • constraints / indexes etc
Parameters
base_ds=Should be two level - eg work.blah. This is the table that is converted to a cards file.
tgt_ds=Table that the generated cards file would create. Optional - if omitted, will be same as BASE_DS.
cards_file=Location in which to write the (.sas) cards file
maxobs=to limit output to the first maxobs observations
showlog=whether to show generated cards file in the SAS log (YES/NO)
outencoding=provide encoding value for file statement (eg utf-8)
Version
9.2
Author
Allan Bowe

Definition in file mp_ds2cards.sas.