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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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