1 The SAS System 18:04 Monday, April 15, 2019 NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.4 (TS1M3 MBCS3170) Licensed to NATIONAL BUREAU OF ECONOMIC RESEARCH, Site 70111350. NOTE: This session is executing on the Linux 3.10.0-957.1.3.el7.x86_64 (LIN X64) platform. NOTE: Updated analytical products: SAS/STAT 14.1 NOTE: Additional host information: Linux LIN X64 3.10.0-957.1.3.el7.x86_64 #1 SMP Mon Nov 26 12:36:06 CST 2018 x86_64 Scientific Linux release 7.6 (Nitrogen) You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. NOTE: SAS initialization used: real time 0.10 seconds cpu time 0.03 seconds 1 options nocenter ; 2 options mprint mlogic symbolgen; 3 *by Jean Roth, jroth@nber.org, 2007-11-09 ; 4 *NOTE: This program is distributed under the GNU GPL. See end of 5 *this file and http://www.gnu.org/licenses/ for details. ; 6 7 * The following line should contain the directory 8 where the SAS file is to be stored ; 9 10 *libname library "~/bulk/cost-reports/hha/"; 11 libname library "/homes/data/hcris/1728-94"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /homes/data/hcris/1728-94 12 13 * The following line should contain 14 the complete path and name of the raw data file. 15 On a PC, use backslashes in paths as in C:\ ; 16 17 %macro loop(FYEAR=,LYEAR=); 18 %let UNDERSCORE=1728_94; 2 The SAS System 18:04 Monday, April 15, 2019 19 %let DASH=1728-94; 20 %do year=&FYEAR. %to &LYEAR.; 21 proc printto log ="/homes/data/hcris/&DASH./read_hha_rpt_rollup&year..log" new; 22 proc printto print="/homes/data/hcris/&DASH./read_hha_rpt_rollup&year..lst" new; 23 24 FILENAME datafile "/homes/data/hcris/1728-94/hha_&year._ROLLUP.CSV"; 25 26 * The following line should contain the name of the SAS dataset ; 27 28 %let dataset=library.hha_rollup1728_94_&year.; 29 30 data &dataset.; 31 32 *hha_dm.* files report lengths; 33 *Using a length of 4 bytes retains 6 significant digits; 34 *Largest integer represented exactly is 2,097,152; 35 *Maximum values apply to 2002-09-30 data file; 36 *max date is around 16000, do length of 4 should be fine for dates; 37 LENGTH rpt_rec_num 5 label $30; 38 * '2C' is hexadecimal for decimal 44 which represents ',' ; 39 * '0D' is hexadecimal for decimal 13 which represents '\r', which is the carriage return character; 40 infile datafile dsd delimiter='2C0D'x ; 41 ** the ":" is a format modifier that reads data values 42 that need additional instructions from an informat; 43 INPUT 44 rpt_rec_num 45 label $ 46 item 47 ; 48 LABEL 49 rpt_rec_num="Report Record Number" 50 ; 51 proc sort data=&dataset.; 52 by rpt_rec_num; 53 54 proc transpose data=&dataset. out=&dataset. (drop=_NAME_ sortedby=rpt_rec_num); 55 by rpt_rec_num; 56 var item; 57 id label; 58 run; 59 60 proc print DATA=&dataset. (obs=5); 61 proc contents DATA=&dataset.; 62 63 %end; 64 %mend; 65 %loop(FYEAR=1994,LYEAR=2018); MLOGIC(LOOP): Beginning execution. MLOGIC(LOOP): Parameter FYEAR has value 1994 MLOGIC(LOOP): Parameter LYEAR has value 2018 MLOGIC(LOOP): %LET (variable name is UNDERSCORE) MLOGIC(LOOP): %LET (variable name is DASH) SYMBOLGEN: Macro variable FYEAR resolves to 1994 SYMBOLGEN: Macro variable LYEAR resolves to 2018 MLOGIC(LOOP): %DO loop beginning; index variable YEAR; start value is 1994; stop value is 2018; by value is 1. SYMBOLGEN: Macro variable DASH resolves to 1728-94 SYMBOLGEN: Macro variable YEAR resolves to 1994 MPRINT(LOOP): proc printto log ="/homes/data/hcris/1728-94/read_hha_rpt_rollup1994.log" new; NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 1:01.00 54 The SAS System 18:04 Monday, April 15, 2019 cpu time 44.32 seconds