/*------------------------------------------------------------------------------------*/ /* * This program selects numeric variables from HCRIS Worksheets that are the old PPS * variables F2135-F2138 F2146 and outputs a SAS dataset * The worksheet code, WKSHT_CD, is as follows : * * "S200000" => "S-2" * "G300000" => "G3" * * PPS99 WKSHT_CD CLMN_NUM LINE_NUM USAGE Notes/Label * ----- -------- -------- -------- ----- ----------- * F25 S200000 0100 01800 num type of control * F26 S200000 0100 01900 num type of hospital * F27 S200000 0100 02000 num type of subprovider * F2135 G300000 0100 00100 num Total Patient Revenues * F2136 G300000 0100 00200 num Less contractual allowances * F2137 G300000 0100 00300 num Net patient revenues * F2138 G300000 0100 00400 num Less total operating expenses * F2139 G300000 0100 00500 num Net income from service to patients * * by Jean Roth, 2003-12-19 ; * Please report any problems or errors to jroth@nber.org * NOTE: This program is distributed under the GNU GPL. * See http://www.gnu.org/licenses/ for details. * Copyright 2004 shared by the National Bureau of Economic Research and Jean Roth */ /*------------------------------------------------------------------------------------*/ options linesize=70; options nocenter; *options obs=10000; libname out v8 '~/bulk'; libname hcris '/homes/data/hcris/'; proc sql; **select appropriate worksheets; create table nmrc as select * from hcris.hosp_nmrc_long where ( ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00100" ) or ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00200" ) or ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00300" ) or ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00400" ) or ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00500" ) or ( WKSHT_CD EQ "S200000" and CLMN_NUM = "0100" and LINE_NUM = "01800" ) or ( WKSHT_CD EQ "S200000" and CLMN_NUM = "0100" and LINE_NUM = "01900" ) or ( WKSHT_CD EQ "S200000" and CLMN_NUM = "0100" and LINE_NUM = "02000" ) ) ; **add varname; data out.nmrc; set nmrc; length varname $32. ; ; *32-character varname maximum; select; *12345678901234567892123456789312; when ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00100" ) varname = "tot_rev"; when ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00200" ) varname = "contract"; when ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00300" ) varname = "net_rev"; when ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00400" ) varname = "tot_op"; when ( WKSHT_CD EQ "G300000" and CLMN_NUM = "0100" and LINE_NUM = "00500" ) varname = "net_inc"; when ( WKSHT_CD EQ "S200000" and CLMN_NUM = "0100" and LINE_NUM = "01800" ) varname = "type_of_control" ; when ( WKSHT_CD EQ "S200000" and CLMN_NUM = "0100" and LINE_NUM = "01900" ) varname = "type_of_hospital" ; when ( WKSHT_CD EQ "S200000" and CLMN_NUM = "0100" and LINE_NUM = "02000" ) varname = "type_of_subprovider" ; otherwise; end; *if varname eq "" then delete; * get rid of any elements of the worksheet we haven't requested; run; proc print data=out.nmrc (obs=60);