BookmarkSubscribeRSS Feed
lilkal
Fluorite | Level 6

Hello.

I am a new SAS User and I have already exhausted the expertise of the OnDemand text support via chat. They suggested that I bring my question here.

 

I a student. I am using SAS Studio OnDemand for Academics. I am using a Mac/IOS software.

 

The assignment requires me to download BRFSS data from the CDC website. One of the data files is in ASCII format and is downloaded from the CDC website as a zipped file. When I unzip the file, it is 903.5 MB.

 

I have created folders in "server files and folders". I have uploaded several of the other files from the CDC website to SAS with no difficulty. When I try to upload the ASC file to SAS, I receive the following error:

 

Unable to load ./‌sasexec/‌sessions/‌04a4b0af-09b9-444a-92ce-aed5c538698b/‌workspace/‌~~ds~~home/‌u58689450/‌LLCP2019.ASC?includeChildren=false&dojo.preventCache=1625842113359 status: 406

 

There are several tutorials, videos, etc that discuss how to upload ASC files BUT they all assume the file has been uploaded to the SAS server. I can't do anything until I can get the file uploaded. 

 

Any help would be greatly appreciated. 

 

16 REPLIES 16
Tom
Super User Tom
Super User

Upload the ZIP file, it will be much smaller.  This means that it will upload faster and it will not exceed the limits that SAS OnDemand puts on file sizes for uploads.

 

It is simple to modify the code they have for reading the file to read directly from the zipped/compressed file.

 

Look for the INFILE and or FILENAME statement in the SAS code that reads the file and adjust it to use the ZIP engine. If the "zip" file is actually a .gz file then add the GZIP keyword also.

lilkal
Fluorite | Level 6
Thanks so much!

I tried uploading the zip file to SAS and received the same error message:

Unable to load ./‌sasexec/‌sessions/‌d87bc5d2-f86e-4b8c-830d-650e250ae9a7/‌workspace/‌~~ds~~home/‌u58689450/‌LLCP2019.ASC?includeChildren=false&dojo.preventCache=1625843080763 status: 406
Reeza
Super User
1. Redownload the file from the home page to ensure it's an uncorrupted file
2. Read it from there
3. Upload the ASC file to a shared public source and you can read it from SAS on Demand there automatically.
lilkal
Fluorite | Level 6
Thank you for your reply.

I don't understand what you mean by "a shared public source". Can you clarify?
Reeza
Super User
SAS can read text files from a URL, so put it in GitHub, DropBox, Google Drive or some place it's accessible via a URL. GitHub blocks files that large from automatic reading I think, so Drive or DropBox should work.
ballardw
Super User

A quick internet search on "406 web error" will show that there are many possible causes.

 

From a fair amount of experience with CDC in general and BRFSS data sets and related sites in specific, I would get a clean download to MY computer before attempting to upload to On Demand. The performance of the CDC website can be very irregular and you may be running into one of the related issues when the CDC site just isn't providing the data quickly enough.

 

lilkal
Fluorite | Level 6
Thanks for your interest.

The zipped file is 64.8 MB and the unzipped version (which is what the tutorial tells me to use, not the zipped file) is nearly 900 MB.
Kurt_Bremser
Super User

The upload limit for On Demand is 10MB, IIRC.

So you need to try to directly load the data from the original source.

But with data that large you might run into other limits of the ODA system.

lilkal
Fluorite | Level 6
Thank you so much, Kurt. That would probably explain the problem!
Reeza
Super User

I don't think that 10MB limit exists anymore. 

 

Here's a way to download the files straight to your Academic on Demands folders, via SAS. 

It should also unzip it into your work folder but I keep getting error messages when I try to read it and unfortunately don't have time to resolve it. 

 

filename BRFSS zip "/home/fkhurshed/Demo1/LLCP2019ASC.zip";

proc http
method='GET'
url="https://www.cdc.gov/brfss/annual_data/2019/files/LLCP2019ASC.zip"
out=BRFSS;
run;

filename ds "%sysfunc(getoption(work))/llcp2019.asc" ;

data _null_;
   /* reference the member name WITH folder path */
   infile BRFSS(LLCP2019.ASC) 
	  lrecl=256 recfm=F length=length eof=eof unbuf;
   file   ds lrecl=256 recfm=N;
   input;
   put _infile_ $varying256. length;
   return;
 eof:
   stop;
run;
 

Log:

 69         filename ds "%sysfunc(getoption(work))/llcp2019.asc" ;
 70         
 71         data _null_;
 72            /* reference the member name WITH folder path */
 73            infile BRFSS(LLCP2019.ASC)
 74           lrecl=256 recfm=F length=length eof=eof unbuf;
 75            file   ds lrecl=256 recfm=N;
 76            input;
 77            put _infile_ $varying256. length;
 78            return;
 79          eof:
 80            stop;
 81         run;
 
 ERROR: Entry LLCP2019.ASC in zip file /home/fkhurshed/Demo1/LLCP2019ASC.zip does not exist.
 ERROR: Physical file does not exist, LLCP2019.ASC.

I can clearly see the file and it exists with the right size so not sure if it's an issue with the case (unix all caps) or something else going on...Good Luck. FYI - if you get it sorted using the XPT file may be easier.

lilkal
Fluorite | Level 6
Wow! This is amazing! Thanks so much for taking the time to work through this. I have forwarded this information and the other comments on to the course professor because I still can't get the data into SAS!


Tom
Super User Tom
Super User

So that method works fine and SAS OnDemand for Academics.

Here is code to download the file and create a fileref named ASC that you could use in the posted SAS code to read the file.

filename brfss temp;

proc http
  method='GET'
  url="https://www.cdc.gov/brfss/annual_data/2019/files/LLCP2019ASC.zip"
  out=BRFSS
;
run;

filename asc zip "%sysfunc(pathname(brfss))" member='*';

Works very quickly. Much faster then downloading to your PC.

 75         filename brfss temp;
 76         
 77         proc http
 78           method='GET'
 79           url="https://www.cdc.gov/brfss/annual_data/2019/files/LLCP2019ASC.zip"
 80           out=BRFSS
 81         ;
 82         run;
 
 NOTE: PROCEDURE HTTP used (Total process time):
       real time           0.29 seconds
       cpu time            0.21 seconds
       
 
 83         
 84         filename asc zip "%sysfunc(pathname(brfss))" member='*';
 85         
 86         data _null_ ;
 87           infile asc end=eof ;
 88           input ;
 89           if _n_=1 or eof then list;
 90         run;
 
 NOTE: The infile ASC is:
       Filename=/saswork/SAS_workA5D400005990_odaws04-usw2.oda.sas.com/#LN00100,
       Member Name=*
 
 RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0                      
 1         01              0101182019     11002019000001                 11 121 0120001              2         
      101  31588881121112112222 222223  1121207                                    232        12127880301540502
      201   22212213 073888      2                2101025553022012033152      412      213                     
      301                                                                              134 42           2222113
      401  1111                                                                                                
      501                                                                                                      
      601                                                                         1001                         
      701                                                                                                      
      801                                                                                                      
      901                                                                                                      
     1001                                                                                                      
     1101                                                                                                      
     1201                                                                                                      
     1301                                                                                                      
     1401   11     101101146.9849076                           0.523.4924538     02                            
     1501                                                                                                      
     1601                                                                                   1 0.5617998190.8192
     1701  82                                                 135.30408                                        
     1801                                                                                                    13
     1901  192122113112                                                        0202  22222213280606215706985281
     2001  73211231200010000012      0176600303                            023330                              
     2101  4233213200000200000700140043005000110002000001141111002121 2158
 418268    72              0903052020     11002019006033                                111121 1  2022         
      101  38888  11213 22 22211221223  2                                          161          121020801200505
      201  22222222    3888      16410203088      8881015551015552021011092019422      2                       
      301                                                                 12                                   
 RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0                      
      401      2  14                                                                                           
      501                                                                                                      
      601                               2                                  12     2002                         
      701                                                                                                      
      801                                                                                                      
      901                                                                                                      
     1001                                                                                                      
     1101                                                                                                      
     1201                                                                                                      
     1301                                                                                                      
     1401           722019144.314527                             1144.314527     05         1                  
     1501                                        0101                                          544.451502      
     1601                                                                                   9           499.167
     1701  55                                                532.437767                                        
     1801                                                                                                    11
     1901  111112221233                                                        0101  18253205142306516505443199
     2001  72134541200010000011035000032460055610030   02000     0006000000000000000600000000060000000000000000
     2101  322222420000010001000000002901000011000100000229111100  21 2158
 NOTE: 418268 records were read from the infile ASC.
       The minimum record length was 2158.
       The maximum record length was 2158.
 NOTE: DATA statement used (Total process time):
       real time           2.74 seconds
       cpu time            2.75 seconds
lilkal
Fluorite | Level 6
Thanks to everyone who replied to this post!

The strangest thing happened yesterday...it worked! I was able to upload the BRFSS ASC file with no problem at around noon. I was in a panic and had just been informed by my prof that I would likely have to choose new data and start the project over. In a last-ditch effort, I tried one more time using the exact method I used at least 20 times before, and the file uploaded like magic.

Perhaps SAS servers were having a rough day last week or maybe a Tech person saw this post and fixed the problem? Who knows? Either way, it worked!

Thanks to you all for taking the time to offer such detailed information. I really appreciate it.

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 16 replies
  • 1279 views
  • 4 likes
  • 5 in conversation