BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Eric_Beckerrr
Fluorite | Level 6

Greetings SAS Community,

 

I have downloaded datasets from the National Data Archive of Child Abuse & Neglect (NDACAN), as well as from Data.gov and Children's Bureau of An Office of the Administration for Children & Families. 

 

1st - I am trying to upload the NDACAN dataset into SAS Viya Workbench Visual Studio Code. But ran into problems, obviously. The dataset is in my external hard drive. 

 

File types: SAS, SPSS. DTA, SAV, DAT, BDAT, XPT, POR, SAS7BDAT, SAS7BCAT, DO, TAB, TRN, SPS.

 

2nd - I am trying to upload these external datasets into SAS in order to create historical volatility index limits for the BioFam Services startup I am trying to secure funding for [ https://linktr.ee/BioFamServices ]

 

*** Yes, I have tried to use various online sources (typed words and video tutorials) but to no avail...

*** Since I am new to SAS, I am having difficulties locating the various tools, options, etc. suggested in the online resources.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Don't try edit a binary file as if it was a text file.

 

You posted a long list of different file types. 

File types: SAS, SPSS. DTA, SAV, DAT, BDAT, XPT, POR, SAS7BDAT, SAS7BCAT, DO, TAB, TRN, SPS.

A .sas file should be a text file you can look at with an editor.

A .spss file I have no idea. It might be a text file with SPSS code you could look at with an editor.

A .dta file is probably a dataset make by STATA.  You should be able to use PROC IMPORT to convert it to a SAS dataset.

A .sav file should be an SPSS dataset.  You MIGHT be able to convert it to a dataset using PROC IMPORT.  But a portable SPSS dataset would work better.

A .dat file might be anything at all.  It could be just a simple text file.  But it might be some complex binary structure.

No idea what a BDAT file would be.

An .xpt file is probably something generated by SAS.  It might be a SAS XPORT file which you can convert using the %XPT2LOC() macro.  But it might also be a SAS CPORT file which you will need to use PROC CIMPORT to convert.

A .por file is probably a portable SPSS dataset. You can use PROC IMPORT to convert it into a SAS dataset.

A .sas7bdat file is a SAS dataset. You should be able to use it directly.  But if your SAS is running on Unix (which if you are using the new SAS Workbench then it is) you need to make sure the physical filename uses only lowercase letters.  

A .sas7bcat file is a SAS catalog.  They are usually not portable across SAS version or operating systems, so most likely that is not usable.

A .do file is probably STATA program file.  You should be able to read that as text.

A .tab file could be anything.  It might be a text file that uses the tab character ('0D'x).  You will need to read that in to make a dataset.  If you do not have descriptions of the fields in the file you could try to use PROC IMPORT to GUESS what the variables are.

Not sure what .trn file is.

A .sps file probably has something to do with SPSS, but not sure if it is program code or data.

 

You can run a simple SAS data step to get a quick LOOK at a file.  This code will dump the first 500 bytes (5 records of 100 bytes each) to the SAS log.

filename myfile 'my physical file name';
data _null_;
  infile myfile lrecl=100 recfm=f obs=5;
  input;
  list;
run;

 

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

This looks like a duplicate post.

Can you describe what you tried to do so far?

 

What interface are you using?

SAS/Studio?  That should have an UPLOAD you can do to copy the files from your local machine to the server you are using.  It should let you specify the target location and select a file (or files) to upload.  Did that part of the process work or not?

 

If it worked then describe what you did to try and work with the files?   Many public access datasets will have instructions for how to convert the files they make available into SAS datasets.

 

If you are using some other interface then please describe it.

Eric_Beckerrr
Fluorite | Level 6

Indeed, it is. Other SAS Community members suggested that I engage with the Viya Workbench forum instead, for more accurate responses.

 

I was able to upload some of the datasets. Three datasets did not upload:   

1. "...The file is not displayed in the text editor because it is very large (231.47MB)...."

2. "...The file is not displayed in the text editor because it is either binary or uses an unsupported text encoding...."

3. "...The file is not displayed in the text editor because it is very large (285.82MB)..."

Tom
Super User Tom
Super User

Don't try edit a binary file as if it was a text file.

 

You posted a long list of different file types. 

File types: SAS, SPSS. DTA, SAV, DAT, BDAT, XPT, POR, SAS7BDAT, SAS7BCAT, DO, TAB, TRN, SPS.

A .sas file should be a text file you can look at with an editor.

A .spss file I have no idea. It might be a text file with SPSS code you could look at with an editor.

A .dta file is probably a dataset make by STATA.  You should be able to use PROC IMPORT to convert it to a SAS dataset.

A .sav file should be an SPSS dataset.  You MIGHT be able to convert it to a dataset using PROC IMPORT.  But a portable SPSS dataset would work better.

A .dat file might be anything at all.  It could be just a simple text file.  But it might be some complex binary structure.

No idea what a BDAT file would be.

An .xpt file is probably something generated by SAS.  It might be a SAS XPORT file which you can convert using the %XPT2LOC() macro.  But it might also be a SAS CPORT file which you will need to use PROC CIMPORT to convert.

A .por file is probably a portable SPSS dataset. You can use PROC IMPORT to convert it into a SAS dataset.

A .sas7bdat file is a SAS dataset. You should be able to use it directly.  But if your SAS is running on Unix (which if you are using the new SAS Workbench then it is) you need to make sure the physical filename uses only lowercase letters.  

A .sas7bcat file is a SAS catalog.  They are usually not portable across SAS version or operating systems, so most likely that is not usable.

A .do file is probably STATA program file.  You should be able to read that as text.

A .tab file could be anything.  It might be a text file that uses the tab character ('0D'x).  You will need to read that in to make a dataset.  If you do not have descriptions of the fields in the file you could try to use PROC IMPORT to GUESS what the variables are.

Not sure what .trn file is.

A .sps file probably has something to do with SPSS, but not sure if it is program code or data.

 

You can run a simple SAS data step to get a quick LOOK at a file.  This code will dump the first 500 bytes (5 records of 100 bytes each) to the SAS log.

filename myfile 'my physical file name';
data _null_;
  infile myfile lrecl=100 recfm=f obs=5;
  input;
  list;
run;

 

Eric_Beckerrr
Fluorite | Level 6

Thanks for your detailed response, time, and dedication, @Tom !