BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hein68
Quartz | Level 8

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!

1 ACCEPTED SOLUTION

Accepted Solutions
AMSAS
SAS Super FREQ

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

 

 

 

View solution in original post

1 REPLY 1
AMSAS
SAS Super FREQ

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

 

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 277 views
  • 2 likes
  • 2 in conversation