BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello All,

I have a program that needs to be manually changed every month to take into account the latest monthly file (I have to add a new libname line every month and add the correspoding libname reference to my SET statement in my DATA step). I could obviously create libname statements for the months that haven't occured yet, but then I would still have to add the libname reference in the DATA step each month or else the program would tell me dataset doesn't exist. Is there any way around this?

Jose
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi,
This is not an ODS question or a BASE Reporting procedure question.

What you want to do can probably be accomplished with the use of SAS Macro programming and several possible methods, which include, but are not limited to using functions that check for data set existence or using the dataset dictionary.tables (assuming that you have issued a LIBNAME statement), or even piping the results of a DIR command to a file and then building the LIBNAME statement and DATA step program dynamically with SAS Macro.

Your best bet for help with this question is to contact Tech Support and/or to search for other papers like this one:
http://www2.sas.com/proceedings/sugi31/029-31.pdf
that show the kind of techniques you would need to use.

cynthia

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
  • 1 reply
  • 938 views
  • 0 likes
  • 2 in conversation