Hi All,
So I am still a bit new to SAS. I am using SAS University and I accidentally let me license laps, so I have SAS University redownloaded, but I am needing to re-import my data that I lost access to when my license lapsed.
I have done this before, but this time around I cannot for the life of me get the data read into SAS :(.
I am using the following code:
data IHC.Emain;
infile '/Users/scott/Documents/Folders/MyFolders/EMainTable.csv' firstobs=2 dlm=',' lrecl=32000 truncover DSD;
length Newid Icupt Dschrg_dspstn_cd Mortly_indctr_cd Primdischdiagcd $ 8
Primdishdiag Admitdiagcd1 $ 8 Admitdiag1 Male Age Imrs Imrsgroup
Imrsgroup3 Rvitestresult Cvhx Hearrate Resprate Sbp dbp Bmi
Minapache Maxapache Hypertensionhx Hyperlipidemiahx Diabhx
Mihx Cadhx Cvahx Tobaccohx Pttype $ 8 Afibhx Dysrhythmiahx
Chfx Copdhx Respfailhx Renalfailhx Liverfailhx Tiahx
Alcoholabusehx Drugabusehx Race $ 8 Pneumonia Adeno H1ni Hmpv
Flua Flub Para Rihino Rsv Corona Bnppreclosest Bnppremax
Bnpindexhospmax Bnpost90dymax Esrindexhospax Gfrindexhospmin
Tropiindexhospmax Tropipost90dymax Sp02indexhospmin
Staphaureusindexhosp Streppneumoindexhosp Afibindexhosp
Chestpainindexhosp Chfindexhosp Cvaindexhosp Dysrhythmiaindexhosp
Fallindexhosp Liverfailindexhosp Malaiseindexhosp Miindexhosp
Respfailindexhosp Sepsisindexhosp Sobindexhosp Wheezeindexhosp
Coughindexhosp Sputum Feverindexhosp Temp Fever Wbc Dxleukocytosis
Leukosytosis Crphsindexhospmax Elevatedcrp Dxhypoxemia Hypoxemia
Anydrug Antibiotic Anticoagulant Anticoagulantother Antiplatelet
Antiviral Betablocker Ccb Corticosteriod Statin Warfarin Fvc
Fivc Tlc Frc_n2 Fef25_75 Pef Fev1 Fev2 Fev3 Fev5 Fev6 Fev75
Dlco Vc Upperrespinfection Tuberculosis Bronchiolitis
Bronchitis Bacterialpneumonia Viralpneumonia Infectiouspneumonia
Influenza Infection Anypneumtest Pntestresult $ 8 Cpneumo Npneumo
Streppneumo Anybactest Anybacpositive Anylungbactest
Lungbacpositive dead Cvdeathhosp Timetodeath Cvprimcauseofdeath
Cvaprimcod Miprimcod Mifu Timetomi Cvafu Timetocva Chfifu
timetochf 8;
input Newid Icupt Dschrg_dspstn_cd Mortly_indctr_cd Primdischdiagcd
Primdishdiag Admitdiagcd1 Admitdiag1 Male Age Imrs Imrsgroup
Imrsgroup3 Rvitestresult Cvhx Hearrate Resprate Sbp dbp Bmi
Minapache Maxapache Hypertensionhx Hyperlipidemiahx Diabhx
Mihx Cadhx Cvahx Tobaccohx Pttype Afibhx Dysrhythmiahx
Chfx Copdhx Respfailhx Renalfailhx Liverfailhx Tiahx
Alcoholabusehx Drugabusehx Race Pneumonia Adeno H1ni Hmpv
Flua Flub Para Rihino Rsv Corona Bnppreclosest Bnppremax
Bnpindexhospmax Bnpost90dymax Esrindexhospax Gfrindexhospmin
Tropiindexhospmax Tropipost90dymax Sp02indexhospmin
Staphaureusindexhosp Streppneumoindexhosp Afibindexhosp
Chestpainindexhosp Chfindexhosp Cvaindexhosp Dysrhythmiaindexhosp
Fallindexhosp Liverfailindexhosp Malaiseindexhosp Miindexhosp
Respfailindexhosp Sepsisindexhosp Sobindexhosp Wheezeindexhosp
Coughindexhosp Sputum Feverindexhosp Temp Fever Wbc Dxleukocytosis
Leukosytosis Crphsindexhospmax Elevatedcrp Dxhypoxemia Hypoxemia
Anydrug Antibiotic Anticoagulant Anticoagulantother Antiplatelet
Antiviral Betablocker Ccb Corticosteriod Statin Warfarin Fvc
Fivc Tlc Frc_n2 Fef25_75 Pef Fev1 Fev2 Fev3 Fev5 Fev6 Fev75
Dlco Vc Upperrespinfection Tuberculosis Bronchiolitis
Bronchitis Bacterialpneumonia Viralpneumonia Infectiouspneumonia
Influenza Infection Anypneumtest Pntestresult Cpneumo Npneumo
Streppneumo Anybactest Anybacpositive Anylungbactest
Lungbacpositive dead Cvdeathhosp Timetodeath Cvprimcauseofdeath
Cvaprimcod Miprimcod Mifu Timetomi Cvafu Timetocva Chfifu
timetochf;
run;
and I get the following error:
ERROR: The path /Users/scott/Documents/MyFolders/EMainTable.csv is not in the list of accessible paths when SAS is in the lockdown state.
I have tried replacing "/Users/scott/Documents/MyFolders" with "/folders" but when I do that I get the following error:
ERROR: Physical file does not exist, /folders/MyFolders/EMainTable.csv.
I checked and the folder the data file is in is the one I have shared with the virtual machine I am using, it has full access and it is set to auto-mount.
I just don't know what I am doing wrong this time... any help or insight would be appreciated!
/Users/scott/Documents/Folders/MyFolders/EMainTable.csv is the path on your Mac. Within the SAS UE virtual machine it should be represented by /folders/myfolder/EMainTable.csv, if you set up UE correctly.
Could be as simple as your use of mixed case in the directory path.
If you are using SAS/studio interface and can find the file in the explorer panel on left of the screen then select it and ask to see its properties. There you can find the path the SAS machine can uses to reference the file. So just copy that and paste it into your program.
/Users/scott/Documents/Folders/MyFolders/EMainTable.csv is the path on your Mac. Within the SAS UE virtual machine it should be represented by /folders/myfolder/EMainTable.csv, if you set up UE correctly.
That was it, I feel so silly. I had been learning to use SAS using that one data set all year, so I never read any other data set in except that one and I had forgotten that step.
Thank you so much!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.