We are using SAS Enterprise Guide. This is the error message we are getting:
ERROR: A lock is not available for DATA.AZPICU1CON_20211122.DATA.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set DATA.AZPICU1CON_20211122 was only partially opened and
will not be saved.
We can't figure out how to resolve this error. This is the code that we are running when the error occurs:
data &consented;
set &out;
if consent=0 then delete;
else if consent=. then delete;
surveydate=datepart(initial_survey_timestamp);
format surveydate date9.;
drop initial_survey_timestamp;
*calculating age;
if childdob^=. then childagec=round(%age(surveydate,childdob)/12, .01);
label childagec="Child age calculated(years)";
if childagec=. then childagec_4cat=.;
else if childagec<1 then childagec_4cat=1;
else if childagec>=1 and childagec<5.9 then childagec_4cat=2;
else if childagec>=5.9 and childagec<13 then childagec_4cat=3;
else if childagec>=13 then childagec_4cat=4;
format childagec_4cat childage.;
label childagec_4cat="Child age calculated_4cat";
if childagec=. then childagec_3cat=.;
else if childagec<1 then childagec_3cat=1;
else if childagec>=1 and childagec<5.9 then childagec_3cat=2;
else if childagec>=5.9 then childagec_3cat=3;
format childagec_3cat childage_3cat.;
label childagec_3cat="Child age calculated_3cat";
run;
Any help would be much appreciated.
Thanks!
This code in isolation should not be generating that error, the error is basically telling you that the dataset is unavailable for write
I'm assuming &consented is set to DATA.AZPICU1CON_20211122
Do you have permission issues, i.e. can you write to the DATA library?
Does another user/process have that dataset open?
What happens if you change the value of &consented e.g. work.test?
Is there additional code that is running or is this the only part of the code?
It would be helpful if you posted the actual log, as that would provide context and potentially other clues
This code in isolation should not be generating that error, the error is basically telling you that the dataset is unavailable for write
I'm assuming &consented is set to DATA.AZPICU1CON_20211122
Do you have permission issues, i.e. can you write to the DATA library?
Does another user/process have that dataset open?
What happens if you change the value of &consented e.g. work.test?
Is there additional code that is running or is this the only part of the code?
It would be helpful if you posted the actual log, as that would provide context and potentially other clues
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: