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 working with Medicaid claims data.  I want to restrict data from claims records to include only family planning claims, and then merge that data with records in a cohort I created.  For the most part, I have been writing my own codes to create annual cohorts and restrict eligibility by certain criteria.  However, selection of family planning claims records is based on diagnostic, procedural, and drug codes.  There are numerous codes that qualify, all of which I am unfamiliar with.  Fortunately, a federal agency has provided SAS code to create macros for applicable selection codes.  Here is my problem.

 

The published code is advanced beyond my programing skills and includes a step where it downloads SAS datasets from a government website, creates a file in a specified location, and converts the downloaded SAS datasets to temporary datasets.  

#1 - For HIPAA compliance, my institution requires that I maintain data on a secure network which blocks internet access while I use it.

#2 - The hyperlink provided in the code is no longer valid.

 

To overcome these obstacles, I manually downloaded the datasets from the new hyperlink and saved the permanent datasets which contain the appropriate family planning codes on the server I am working off of.  I believe I have deciphered the code enough so that, if I convert the downloaded datasets to temporary datasets in my work library, the rest of the code will run.  

 

My question is this.  There are numerous datasets in the downloaded file.  They have a common naming convention, lookup_'type'_'year' (ex. lookup_diaphram_2013).  Is there an efficient way to convert all datasets contained in my download file to temporary SAS datasets, maintaining their original naming convention?

 

Thanks,

 

Ted 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Take a loop at PROC COPY.  The program will be very short, along the lines of:

 

libname perm "path to your folder with permanent data";

 

proc copy in=perm out=work;

 

 

You might need to add another statement such as "select all" but the documentation for PROC COPY will guide you.

View solution in original post

2 REPLIES 2
Astounding
PROC Star

Take a loop at PROC COPY.  The program will be very short, along the lines of:

 

libname perm "path to your folder with permanent data";

 

proc copy in=perm out=work;

 

 

You might need to add another statement such as "select all" but the documentation for PROC COPY will guide you.

LEINAARE
Obsidian | Level 7

Hi Astounding,

 

Wow.  Thank you.  That worked perfectly.  I was unaware of that procedure!

 

Sincerely,

 

Ted

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
  • 2 replies
  • 756 views
  • 0 likes
  • 2 in conversation