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

I want to dynamically import a filename depending on the month and year. For example, for October 2021 the filename I want to import is exco_fte_202110. I have the following code, which works in SAS Studio. However, in Enterprise Guide, I get the note: "NOTE: The quoted string currently being processed has become more than 262 bytes long. You might have unbalanced quotation marks."

 

%let sysmonth= %sysfunc(putn("&sysdate"d, MONTH2.));
%let sysyear= %sysfunc(putn("&sysdate"d, YEAR4.));

%put OracLib.exco_fte_&sysyear.&sysmonth.;

 

Something minor is missing - what is it?

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Can you post the full log? That error sometimes relates to the autogenerated code than your code.

Something like this would probably be just as easy:

%put OracLib.exco_fte_%sysfunc(today(), yymmn6.);

View solution in original post

3 REPLIES 3
Reeza
Super User
Can you post the full log? That error sometimes relates to the autogenerated code than your code.

Something like this would probably be just as easy:

%put OracLib.exco_fte_%sysfunc(today(), yymmn6.);

Reeza
Super User
SYSDATE is an automatic macro variable but it's when the session started.
If you're on a server, this may not return what you expect, so do you want to use the TODAY() function instead?
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n08zfkx3lmiagpn11fctkfvfx1sg.htm
ballardw
Super User

Check the quotes around your file name and any options in the step you actually export the data. Look for mismatched quotes.

 

Or copy your log, open a text box on the forum with the </> icon and paste the log showing the code and error message(s).

 

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 651 views
  • 5 likes
  • 3 in conversation