Learning SAS? Welcome to the exclusive online community for all SAS learners.

Practice datasets

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Practice datasets

Hi,

I have a sample sas dataset which is of windows pc format.

I am currently having SAS university edition in Virtual Box.

How can i convert these datasets into the ones compatible in SAS university edition ?


Accepted Solutions
Solution
‎06-19-2014 01:09 PM
SAS Super FREQ
Posts: 8,742

Re: Practice datasets

Hi:

  You should only need to move the datasets to your shared folder (the folder on your PC that is shared with the Virtual Machine). Then you need to issue a LIBNAME statement that points to the shared folder. There should be no need for conversion. For example, if I have a folder on my C: drive called

C:\SASUniversityEdition\myfolders\all_SAS_data

and the folder has 3 SAS datasets stored in it, I can point to the data from inside SAS Studio with this LIBNAME statement (assuming that I have set up shared folders for my Virtual Machine):

libname mydata '/folders/myfolders/all_SAS_data';

  Note that the slashes used in the LIBNAME statement are NOT "Windows" slashes \ (back slash), but instead are UNIX slashes / (forward slash).

  Do note that the Windows folder path where I see the data in Windows Explorer is NOT the correct path to use inside a SAS program in SAS Studio. Assuming you have made a shared folder called SASUniversityEdition, with a subfolder of myfolders and another subfolder called all_SAS_data, then all the SAS datasets in that directory should be visible to my programs if I run the correct LIBNAME statement.  (a SAS dataset generally has a file extension of SAS7BDAT)

  Please see the attached screen shots. They show a Windows Explorer view of my existing SAS datasets in a folder on my C: drive (that I have shared with my Virtual Machine). Then, there's a screen shot of the Program Code, the partial results and the LOG messages. If you see "Cross Environment Data Access" or CEDA messages in the log, this is not a deal breaker. It just means (usually) that the files were created on some other operating system, possibly a Windows 32 bit machine. You can read more about this message here 15379 - Cross-Environment Data Access (CEDA) utilization message

  For instructions about how to set up shared folders, please refer to the how-to instructions videos for the University Edition -- the method to set up shared folders is specific to the virtual machine software you chose to install.

cynthia


UE2_SAS_Studio_Program.pngUE3_partial_results.pngUE4_see_log_possible_CEDA_note.pngUE1_shared_folder_with_data.png

View solution in original post


All Replies
Super User
Posts: 17,784

Re: Practice datasets

Is your dataset a .sas7bdat file?

If so, it should work out of the box. Create the appropriate shared drive in the VM and then map a library to the path.

There was an answer on here yesterday on how to set up shared drive with the VM if you need instructions.

Solution
‎06-19-2014 01:09 PM
SAS Super FREQ
Posts: 8,742

Re: Practice datasets

Hi:

  You should only need to move the datasets to your shared folder (the folder on your PC that is shared with the Virtual Machine). Then you need to issue a LIBNAME statement that points to the shared folder. There should be no need for conversion. For example, if I have a folder on my C: drive called

C:\SASUniversityEdition\myfolders\all_SAS_data

and the folder has 3 SAS datasets stored in it, I can point to the data from inside SAS Studio with this LIBNAME statement (assuming that I have set up shared folders for my Virtual Machine):

libname mydata '/folders/myfolders/all_SAS_data';

  Note that the slashes used in the LIBNAME statement are NOT "Windows" slashes \ (back slash), but instead are UNIX slashes / (forward slash).

  Do note that the Windows folder path where I see the data in Windows Explorer is NOT the correct path to use inside a SAS program in SAS Studio. Assuming you have made a shared folder called SASUniversityEdition, with a subfolder of myfolders and another subfolder called all_SAS_data, then all the SAS datasets in that directory should be visible to my programs if I run the correct LIBNAME statement.  (a SAS dataset generally has a file extension of SAS7BDAT)

  Please see the attached screen shots. They show a Windows Explorer view of my existing SAS datasets in a folder on my C: drive (that I have shared with my Virtual Machine). Then, there's a screen shot of the Program Code, the partial results and the LOG messages. If you see "Cross Environment Data Access" or CEDA messages in the log, this is not a deal breaker. It just means (usually) that the files were created on some other operating system, possibly a Windows 32 bit machine. You can read more about this message here 15379 - Cross-Environment Data Access (CEDA) utilization message

  For instructions about how to set up shared folders, please refer to the how-to instructions videos for the University Edition -- the method to set up shared folders is specific to the virtual machine software you chose to install.

cynthia


UE2_SAS_Studio_Program.pngUE3_partial_results.pngUE4_see_log_possible_CEDA_note.pngUE1_shared_folder_with_data.png
New Contributor
Posts: 2

Re: Practice datasets

One small clarification: The datasets that you have are the ones which are usual sas datasets that work in desktop sas right? or are they sas datasets compatible for unix sas ?

Super User
Posts: 17,784

Re: Practice datasets

The platform doesn't matter for SAS datasets (v7+), in that they will work elsewhere. At worse case you'll get the CEDA warning.

New Contributor
Posts: 4

Re: Practice datasets

Hi Cynthia,

I am trying to read a sas dataset but I am unable to using the the sas studio.

I have a shared folder, and I have created a folder in the share folder just using  your example  all_sas_data when I run the code , it shows that the library does not exist.

this is the code

libname mydata '/folders/myfolders/all_sas_data';

this is the error message

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 libname mydata '/folders/myfolders/all_sas_data';

NOTE: Library MYDATA does not exist.

44 ;

45 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

55 ;

Please help

Super User
Posts: 17,784

Re: Practice datasets

Can you post a screenshot of your folder structure? If not contact SAS tech support for UE at sasanalyticsu@sas.com

New Contributor
Posts: 4

Re: Practice datasets

"C:\Users\hwakadha\Documents\SASUniversityEdition\myfolders\all_sas_data"

Frequent Contributor
Posts: 103

Re: Practice datasets

HeLP!!! please.

I use VMplayer in Fedora linux and im trying to call this data set i produce before, this data set is into the WORK library:

the data is named "R_circ"

data plusmaze;

libname R_Circ '~';

if genotype=1 then alpha = -1;

else if genotype=2 then alpha = 0;

else alpha = 1;

delta = 0;

if genotype=2 then delta = 1;

datalines;

Thanks

Community Manager
Posts: 552

Re: Practice datasets

Hi jonatan.velarde, please consider opening a separate discussion so that more community members will see your inquiry. Odds of getting a helpful response will increase if you can elaborate more. Tips for writing a good inquiry are here and here.

New Contributor zh
New Contributor
Posts: 2

Re: Practice datasets

I have same issue. I have downloaded SAS University Edition vm.

 

This is my shared folder which I have attached to vm setting:

C:\zahir\myworks\SAS\UnivEdition

 

I have created a sub folder testdata1 as below:

 

C:\zahir\myworks\SAS\UnivEdition\testdata1

 

But I am getting following message:

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 55         
 56         *libname _all_ list;
 57         libname saszahir  '/folders/testdata1';
 NOTE: Library SASZAHIR does not exist.
 58         

 

Here is my code:

 

libname saszahir  '/folders/testdata1';

 

Is /folders a must addition infront of actual subfolder name?

 

New Contributor zh
New Contributor
Posts: 2

Re: Practice datasets

Could you clarify this more:

C:\SASUniversityEdition\myfolders\all_SAS_data

and

libname mydata '/folders/myfolders/all_SAS_data';

 

is /folders is the replacement of C:\SASUniversityEdition

 

I have C:\zahir\myworks\SAS\UnivEdition folder as shared in virtual machine.

And this is a subfolder:

C:\zahir\myworks\SAS\UnivEdition\testdata1

 

what should be my libname command if I want to store data set under testdata1?

 

libname saszahir  '/folders/UnivEdition/testdata1; (?)

 

or

libname saszahir '/zahir/myworks/SAS/UnivEdition/testdata1';

 

Please clrify ...

 

Thank you.

 

New Contributor
Posts: 4

Re: Practice datasets

Hi Cynthia ,

I have created a folder in my  shared folder but when I run the code to give it a libref it gives me an error that the my library has not be created. please help .

this is code:

'libname mydata '/folders/myfolders/all_sas_data';

This is the error

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

42 ;

43 libname mydata '/folders/myfolders/all_sas_data';

NOTE: Library MYDATA does not exist.

44 ;

45 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

55 ;

Super User
Posts: 17,784

Re: Practice datasets

You created a folder called all_sas_data under myfolders?

Does the following work:

libname test '/folders/myfolders';

New Contributor
Posts: 4

Re: Practice datasets

Hi Reeza, Yes that works but the additional folder does not .

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 14 replies
  • 6212 views
  • 9 likes
  • 7 in conversation