Hello
I'm very new to SAS (using 9.0) so please don't laugh too hard if this is an easy question!
I have a very large text file that I am importing. The first data set is for specific institutions and the second dataset is for specific residence codes minus the institution codes from the first data set.
I can do that no problem but my issue is with trying to append the second dataset to the first at runtime. I have been able to do it by first creating the second set and then appending the files but I want to append while running the second so I don't have such huge files on my computer.
OR if there is a way to create one file from both data programs that would be good too.
Below is my code:
1.
data mylib.NACRS2005Hosp;
infile 'd:\Data Files\Data Release\NACRS.FY200405.txt' LRECL = 3000;
input @1 Inst $5.;
if Inst not in ('53987','54108','54197','54241','54249','54258','54320','54413') then delete;
input @6 Fyear $4.
@10 Period 2.
@35 IssProv $2.
@59 Enc $3.
@62 Postal $6.
@68 Rescode $7.
@75 Sex $1.
@85 FP $1.;
run;
2.
data mylib.NACRS2005Res;
infile 'd:\Data Files\Data Release\NACRS.FY200405.txt' LRECL = 3000;
input @1 Inst $5.;
if Inst in ('53987','54108','54197','54241','54249','54258','54320','54413') then delete;
input @6 Fyear $4.
@10 Period 2.
@35 IssProv $2.
@59 Enc $3.
@62 Postal $6.
@68 Rescode $7.;
If Rescode not in ('3301','3302','3305','3306','3307','3317','3329','3331','3334','3337','3338','3341','3344','3345','3346','3347','3348','2001','2002','2003','2004','2005','2006','2007','2008','0731','0739','0832','2721','3319') then
input @75 Sex $1.
@85 FP $1.;
run;
Any and all assistance greatly appreciated.
Shelby
I'm very new to SAS (using 9.0) so please don't laugh too hard if this is an easy question!
I have a very large text file that I am importing. The first data set is for specific institutions and the second dataset is for specific residence codes minus the institution codes from the first data set.
I can do that no problem but my issue is with trying to append the second dataset to the first at runtime. I have been able to do it by first creating the second set and then appending the files but I want to append while running the second so I don't have such huge files on my computer.
OR if there is a way to create one file from both data programs that would be good too.
Below is my code:
1.
data mylib.NACRS2005Hosp;
infile 'd:\Data Files\Data Release\NACRS.FY200405.txt' LRECL = 3000;
input @1 Inst $5.;
if Inst not in ('53987','54108','54197','54241','54249','54258','54320','54413') then delete;
input @6 Fyear $4.
@10 Period 2.
@35 IssProv $2.
@59 Enc $3.
@62 Postal $6.
@68 Rescode $7.
@75 Sex $1.
@85 FP $1.;
run;
2.
data mylib.NACRS2005Res;
infile 'd:\Data Files\Data Release\NACRS.FY200405.txt' LRECL = 3000;
input @1 Inst $5.;
if Inst in ('53987','54108','54197','54241','54249','54258','54320','54413') then delete;
input @6 Fyear $4.
@10 Period 2.
@35 IssProv $2.
@59 Enc $3.
@62 Postal $6.
@68 Rescode $7.;
If Rescode not in ('3301','3302','3305','3306','3307','3317','3329','3331','3334','3337','3338','3341','3344','3345','3346','3347','3348','2001','2002','2003','2004','2005','2006','2007','2008','0731','0739','0832','2721','3319') then
input @75 Sex $1.
@85 FP $1.;
run;
Any and all assistance greatly appreciated.
Shelby