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

Hello,

 

I am trying to run the following code I downloaded from a government website.

 

*=============================================================================;
*  DOWNLOAD THE LATEST LOOKUP TABLES WITH CONTRACEPTIVE CLAIMS CODES 
*=============================================================================;
%let urldir = https://www.hhs.gov/opa/sites/default/files/; 	
%macro getlookup(tablename);
   filename _inbox "%sysfunc(getoption(work))/&tablename..sas7
bdat";
   proc http 
      method="get" url="&urldir.&tablename..sas7bdat" out=_inbox;
      run;
%mend;																													*...Claims code tables will now be downloaded to work library and directly readable;
%getlookup(lookup_iud_&year.);  
%getlookup(lookup_infecund_&year.);
%getlookup(lookup_pregnancy_&year.);
%getlookup(lookup_non_live_birth_&year.);
%getlookup(lookup_live_birth_&year.);
%getlookup(lookup_sterilization_&year.);
%getlookup(lookup_implant_&year.);
%getlookup(lookup_injectable_&year.);
%getlookup(lookup_oral_pill_&year.);
%getlookup(lookup_patch_&year.);
%getlookup(lookup_ring_&year.);
%getlookup(lookup_diaphragm_&year.);

 

I get the following note in my log.

"NOTE: PROCEDURE HTTP used (Total process time):

real time 1.01 seconds

cpu time 0.00 seconds

NOTE: 404 Not Found"

 

I looked up the error, and it seems it is related to a JAVA virtual machine error.  Could anyone offer any help as how to resolve this?

 

Thanks,

 

Ted

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

@LEINAARE wrote:

I was able to download a file containing the SAS datasets available online and store it on my desktop.  Is there anyway to modify the %getlookup macro to function in a similar way to read datasets stored on my computer?


From the portion you've shown, that's actually all this macro did, download the files.

View solution in original post

9 REPLIES 9
Reeza
Super User
This is the 404 error, ie page not found when trying to access the URL. Is &year defined? WHat values does it take?

When I try and use it with year=2015 I get the same error.
LEINAARE
Obsidian | Level 7

Hi Reeza,

 

This is a small excerpt from a very large code that calls multiple component programs.  However, I have not been able to find any step that specifically defines 'year'.  The datasets it is trying to download are from 2013-2016.

r_behata
Barite | Level 11

I have followed the URL :  

"https://www.hhs.gov/opa/sites/default/files/"

Which Says :

 

Page Not Found

We're sorry, but there is no www.hhs.gov page that matches your entry. Possible reasons:

  • The page may have been moved,
  • It no longer exists, or
  • The address may have been typed incorrectly.

 

 

Apparently the Site has changed since the code was written.

LEINAARE
Obsidian | Level 7

Hi r_behata,

 

I tried that as well, and got the same message.  The data tables referenced in the original program can be found at https://www.hhs.gov/opa/performance-measures/claims-data-sas-program-instructions/index.html .

But, when I replaced the URL with the link above, it did not execute either.

r_behata
Barite | Level 11

Hi @LEINAARE 

 

You will have to find the new web file server link where the data files are hosted in case the URL has changed. Simply replacing the URL with a HTML page might not work.

 

 

LEINAARE
Obsidian | Level 7

Hi @r_behata

 

Thank you for the suggestion.  I will email the contact on that page and see if there is an updated URL.  

 

Thanks,

 

Ted

LEINAARE
Obsidian | Level 7

I was able to download a file containing the SAS datasets available online and store it on my desktop.  Is there anyway to modify the %getlookup macro to function in a similar way to read datasets stored on my computer?

Reeza
Super User

@LEINAARE wrote:

I was able to download a file containing the SAS datasets available online and store it on my desktop.  Is there anyway to modify the %getlookup macro to function in a similar way to read datasets stored on my computer?


From the portion you've shown, that's actually all this macro did, download the files.

LEINAARE
Obsidian | Level 7

Hi @Reeza,

 

Thanks for taking a look at this.  I used proc copy to convert the datasets contained in the download file to temporary datasets, which is what I believe the larger body of program needs. 

 

Thanks,

 

Ted

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 3891 views
  • 2 likes
  • 3 in conversation