BookmarkSubscribeRSS Feed
nanako_ohashi
Fluorite | Level 6

Hi guys,

 

I failed my first attempt at the SAS 9.4 Base Programming -- Performance-based exam today. The one major issue I had was accessing the files used for the exam. For the project part of the exam, we need to manipulate datasets in the files in the input folder. However, when I attempt to manipulate the datasets, the error message read that I was not authorized to modify the files. I spent more than an hour of my exam trying to figure this out. What am I not getting here? Are we supposed to know code to modify authorized files? Or is there some kind of password we use to be able to modify the files? I feel like there is something simple I am not getting here.

 

It sucks because I wasted a lot of time doing this instead of attempting to actually answer the questions. I want to do way better the next time around and want to figure this out!

 

Thank you all and have a nice day!

12 REPLIES 12
Duggins
Obsidian | Level 7

Those files are in a read-only folder, so that test-takers cannot inadvertently change the data and make it impossible to complete the exam correctly. 

 

You need to save the data sets in a library you set up or in the Work library. For example, you cannot just say 

proc sort data = sashelp.cars;
  by msrp;
run;

because you do not have write-access to the SasHelp library. You just need to use the OUT= option (in this case) to ensure you select an appropriate library in which to save the data. 

There is a very thorough answer that addresses this question here: https://communities.sas.com/t5/SAS-Communities-Library/Tips-and-Strategies-for-the-A00-231-SAS-Base-...


nanako_ohashi
Fluorite | Level 6

Hi dugginsj,

 

I wrote the following code as a test and it seems to work. Can you confirm that this is what you were talking about?

 

/* make folder/library read-only */
libname original '/folders/myfolders/original' ACCESS=READONLY;

/* create new folder/library */
libname editable '/folders/myfolders/editable';

/* copies all files in 'original' library and moves them to 'editable' library */
proc datasets library=original;
copy out= editable;
run; 

 Thanks!

Duggins
Obsidian | Level 7

You *could* do it that way, but using PROC DATASETS to copy all the files is a much more broad-spectrum approach than I was suggesting. During the project portion, anytime you are asked to work with a data set you have control over where you store the results. So, yes, you need to establish your own library like you did in your LIBNAME statement, but then you just need to use it when you store the results you create. 

For example, if you are asked to sort a data set, then use OUT= in PROC SORT to save it to your library. If you are modifying data in a DATA step, then make sure your DATA statement saves the results in your library rather than trying to overwrite the data you are provided. (These are both good programming practices anyway, but in the testing environment they are required.) @Mark2010 gives a pretty good run down of the process in his example videos - but maybe you ran into an issue that I'm not understanding. In any case, I cannot imagine a scenario where you would want to copy over all the data sets - this is a timed exam, so I'd advise test-takers to be spending their time only working with the required data sets!

nanako_ohashi
Fluorite | Level 6

Hi dugginsj,

 

I watched the videos from @Mark2010 several times and did not see any examples of how I can do what you explained in your last response. He mentions the write-protected files, but no examples of how he accesses the data.

 

If you could provide an example of how to use the out= in proc sort, it would help me immensely! I don't really understand where to insert the out= statement in a proc statement.

 

Using your example in your previous reply, here is my attempt:

libname editable '/folders/myfolders/editable';

proc
sort data = sashelp.cars;
out= editable.cars; by msrp; run;

 

Thank you for all the time you have spent clarifying this concept!

Duggins
Obsidian | Level 7

The PROC SORT code  you listed has a syntax error - there is no OUT statement in PROC SORT. Here are a few examples, including the SORT code first.

 

proc sort data = sashelp.cars out = MyCars;
  by Origin Cylinders;
run;

libname Example '.';

data Example.MyShoes;
  set SasHelp.Shoes;
  attrib SalesCat length = $ 8;
  if sales LE 100000 then SalesCat = 'Tier A';
    else if Sales LE 200000 then SalesCat = 'Tier AA';
      else if Sales GT 200000 then SalesCat = 'Tier AAA';
  if SalesCat ne 'Tier A';
run;

 

The first example sorts the read-only data set SasHelp.Cars and saves the result in your Work library as MyCars. This uses the OUT= option to avoid sorting the data set in place which is the default of PROC SORT.

The second example is adapted (because I don't remember the exact details) from @Mark2010's video where he demonstrates the testing environment. It reads in the SasHelp.Shoes data set, which is also read-only for you, and subsets the data. The subset is stored in the Example library, which I created with the LIBNAME statement. (Note, when doing this you need to make sure the path you select points to a location where you have write-access.)

If you're still having an issue knowing when/how to work with files using read- vs write-access. I'd suggest taking a look at either the certification guides, a SAS book (full disclosure, I'm an author of one, but there are lots of options that would cover this content), or even digging into the SAS documentation. The syntax can vary from PROC to PROC on how to save your data (or use ODS OUTPUT to simplify the syntax), so there is no "one size fits all" approach to this topic.

 

Mark2010
SAS Employee

SAS documentation is also helpful for all sorts (pun intended) of questions you may have while learning SAS and preparing for certification exams. I tend to use Google with a prefix of "SAS 9.4"  such as in this case I would search for "SAS 9.4 PROC SORT OUT="

 

I hit the first result from Google, click on examples and see that even the basic examples of PROC SORT include an OUT= statement (which is a best practice in my opinion because it doesn't alter your original data set).

https://documentation.sas.com/?docsetId=proc&docsetVersion=9.4&docsetTarget=n0sv3pcvpllvh9n1521qlriu...

 

 

sustagens
Pyrite | Level 9
You almost got it right - except the placing. The statement, "out=editable.cars" should be right after "data=sashelp.cars" and then the semicolon.
bsd70
Fluorite | Level 6
Hello
SAS Expert/Technician

I am writing again about SAS A00-231 Performance base Exam. I read the document “Accessing SAS and Setting up Files for this Practice Exam” where how to upload practice exam. I had uploaded the BaseCert folder and took the practice exam successfully.

https://vle.sas.com/mod/resource/view.php?id=229404

Also, I reviewed the content “Using the SAS Virtual Lab”.
Is this about real exam environment talking about?
This describes as per below:
In the Files and Folders panel on the left, expand S:\ > workshop > cert. The cert folder contains all the files you need for this exam. It has 4 subfolders: errors, input, output and programs. The output and programs folders will be used to save programs and results during the practice exam.
Is these same rules apply for real exam?

In real exam, SAS Studio launches in the lab (Virtual Lab). In the SAS A00-231 exam, input data located at C:/cert/Input. I had assigned the Libname input “C:/cert/Input”. I was not able to access data and spent hour. Later, I requested issue and received case number.

What is correct guidance to access the data and bring the input data in to program with correct code to use in the real exam?

Looking forward for correct reply.

Thanks
Mark2010
SAS Employee

 The exam files are similar in structure to what you describe in the "S:\ > workshop > cert." paragraph, but the specific directory names will be different. The exam provides the specific instructions to access the correct directories for input and output data sets.

Note that the input files are write protected so that candidates cannot accidentally corrupt the data and then have no way to get the question right if they make a mistake. 

In your previous exam attempt, if you were not able to access the data, then your library assignments were not defined correctly or you may have been trying to alter a read-only data set.

bsd70
Fluorite | Level 6

Hi Mark,

Thanks for your reply.

In real exam, it was described that file is located at "C:/Cert" and within Cert folder, there was 4 folders: Input, Errors, Output, and Programs. Input data was in the "Input" folder. I had assigned the = libname input "C:/Cert/Input"; After using this libname reference in the set statement= set input.input28; but i was not getting data in output window. Also, I had checked the properties of "Input" folder and  size was 0 bytes. I saw the all input datasets name but after executing the proc sort with set statement, it was null at output tab. I belived that Virtual Lab was not loaded with data or any contents. 

Is it any other concers?

Great! Thanks

Mark2010
SAS Employee

@bsd70 just a note of caution about discussing exam materials in public forums - It is a violation of the candidate agreement. You haven't crossed the line but you are close. Specific exam concerns should be addressed to certification@sas.com via email.

 

That being said, I assure you that your input data folder contained the data sets (I checked your lab as you tested recently and the data is still there). Given that all exam labs are simply copied from a master template virtual machine at the start of your exam, there is 0 chance that corruption in the template could result in the data being missing. It's possible if the bits got scrambled in the copy that the entire lab would not work (though I've never seen this occur), but no-way could there be missing files.

 

Trust that your SAS is executing your code exactly as you have written it, and if it's not working right, the problem is the code. It's like a magic genie. If you tell it "Make me a peanut butter sandwich", don't be upset when you are suddenly turned into a PB sandwich. This takes a combination of humility to accept that the code isn't right and confidence that you have the skills to fix it. It is possible that your code was syntactically correct and produced no errors, but was logically wrong. You may have used one libname in your LIBNAME statement and another in your PROC SORT. And a note on PROC SORT: It is important to understand where the sorted data is created by default without any additional options. The A00-231 Exam Content Guide  is your friend here.

 

Best of luck in your exam preparations.

 

 

 

 

bsd70
Fluorite | Level 6

Hi Mark,

I am sorry about if any. I reviewed previous post about this issue to get knowledge and I have written my experience. I have used the contents as given in the publicized content materials. My intension is learning and share good vibes. I have reviewed documents and videos before taking exams as per link given. I will do so again if I am missing any.

Thanks for your support.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 12 replies
  • 2823 views
  • 8 likes
  • 5 in conversation