a program for exporting sas datasets to argus johan heldal statistics norway
TRANSCRIPT
![Page 1: A program for exporting SAS datasets to Argus Johan Heldal Statistics Norway](https://reader035.vdocuments.site/reader035/viewer/2022080905/56649d095503460f949da7eb/html5/thumbnails/1.jpg)
A program for exporting SAS datasets to Argus
Johan Heldal
Statistics Norway
![Page 2: A program for exporting SAS datasets to Argus Johan Heldal Statistics Norway](https://reader035.vdocuments.site/reader035/viewer/2022080905/56649d095503460f949da7eb/html5/thumbnails/2.jpg)
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.
![Page 3: A program for exporting SAS datasets to Argus Johan Heldal Statistics Norway](https://reader035.vdocuments.site/reader035/viewer/2022080905/56649d095503460f949da7eb/html5/thumbnails/3.jpg)
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;
![Page 4: A program for exporting SAS datasets to Argus Johan Heldal Statistics Norway](https://reader035.vdocuments.site/reader035/viewer/2022080905/56649d095503460f949da7eb/html5/thumbnails/4.jpg)
The metafile (utvalg.rda)<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.
![Page 5: A program for exporting SAS datasets to Argus Johan Heldal Statistics Norway](https://reader035.vdocuments.site/reader035/viewer/2022080905/56649d095503460f949da7eb/html5/thumbnails/5.jpg)
The input file (.sas)INFILE &OUTPATH\&DATASET..saf DELIMITER=';' DSD;INPUTt_senter : $CHAR2.kjonn : $CHAR1.barn : 8.sivstand : $CHAR1.samtykke : $CHAR1.retur : $CHAR1.res : $CHAR1.utland : $CHAR4.land : $CHAR4.fylke : $CHAR4.alder : 8.;
![Page 6: A program for exporting SAS datasets to Argus Johan Heldal Statistics Norway](https://reader035.vdocuments.site/reader035/viewer/2022080905/56649d095503460f949da7eb/html5/thumbnails/6.jpg)
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.