1 / 6

A program for exporting SAS datasets to Argu s

A program for exporting SAS datasets to Argu s. Johan Heldal Statistics Norway. SAS macro TOARGUS. Reads a SAS dataset Outputs a .csv file, ’;’ separated Creates an ARGUS meta data file (.rda) Applies to both Mu and Tau

della
Download Presentation

A program for exporting SAS datasets to Argu s

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A program for exporting SAS datasets to Argus Johan Heldal Statistics Norway

  2. SAS macro TOARGUS • Reads a SAS dataset • Outputs a .csv file, ’;’ separated • Creates an ARGUS meta data file (.rda) • Applies to both Mu and Tau • Creates an INPUT statement (.sas) for reading a safe file from Mu back to SAS. • An open code for anybody to improve.

  3. How to run TOARGUS %LET LIBNAME = NIH; * The libname for the SAS dataset; %LET INPATH = REMOTE '$METODER/1253/NIH_kartlegging/wk12' SERVER=ovibos; * Path to the SAS dataset; %LET DATASET = utvalg; * The name of the SAS dataset; %LET OUTPATH = H:\ESSnet\Confidentiality; * Directory for .csv and .rda files; %LET KEEP = t_senter kjonn barn sivstand samtykke retur res utland land fylke alder; * The variables to be transferred; /* Run the macro. */ %INCLUDE"H:\ESSnet\Confidentiality\SAS-Argus\ToArgus.sas"; %TOARGUS;

  4. <SEPARATOR> ";" t_senter 2 <RECODABLE> kjonn 1 <RECODABLE> barn 8 . <NUMERIC> sivstand 1 <RECODABLE> samtykke 1 <RECODABLE> retur 1 <RECODABLE> res 1 <RECODABLE> utland 4 <RECODABLE> land 4 <RECODABLE> fylke 4 <RECODABLE> alder 8 . <NUMERIC> Metadata specific for confidentiality should be specified in ARGUS i.e. sample weight, holding indicator, request, household identifier, suppressweight etc. The metafile (utvalg.rda)

  5. The input file (.sas) INFILE &OUTPATH\&DATASET..saf DELIMITER=';' DSD; INPUT t_senter : $CHAR2. kjonn : $CHAR1. barn : 8. sivstand : $CHAR1. samtykke : $CHAR1. retur : $CHAR1. res : $CHAR1. utland : $CHAR4. land : $CHAR4. fylke : $CHAR4. alder : 8. ;

  6. Next to do • Write code for generation of codelist files (.cdl) from associated SAS-formats. • Write SAS macro for generation of tabular input to Tau. • The table with relevant information and metafile.

More Related