BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
morenayan
Fluorite | Level 6

my question is about %include code, which is used in primary.sas to include my setup.sas, my goal is to set up a sas library named RAW. my code been as follows:

 

 *-----------first sentence in my primary.sas;
%include "/home/u63676684/template/myproject/Report/Macro/setup.sas";
*------------my setup.sas;
dm "log; clear;"; dm "out; clear;"; options missing = '' ; libname _all_ clear ; %let server=/home/u63676684/template; %let project=myproject; libname raw "&Server/&Project/data/rawdata";

1. when I run my setup.sas alone, RAW can be successfully set up as a sas library. 

2. when I run my primary.sas to try to include my setup.sas, RAW cannot be created, without any ERROR or WARNING in my log, only with a NOTE: library “RAW” doesn't exist.

I have already checked all the pathname. They are set correctly.

Are there any points I should pay attention to? I'd appreciate it if you could point it out!🥹

 

my sas is set up in sas studio, macos

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Submit this

*-----------first sentence in my primary.sas;
options mprint mlogic symbolgen;
%include "/home/u63676684/template/myproject/Report/Macro/setup.sas" / source2;

... and the LOG will tell you more.

 

Koen

View solution in original post

3 REPLIES 3
sbxkoenk
SAS Super FREQ

Submit this

*-----------first sentence in my primary.sas;
options mprint mlogic symbolgen;
%include "/home/u63676684/template/myproject/Report/Macro/setup.sas" / source2;

... and the LOG will tell you more.

 

Koen

morenayan
Fluorite | Level 6

thanks a lot, 

as you say, the log tell me more: it seems like my macro project name is parsed as messy code

 

my setup.sas is coded as GB2312, my primary.sas is coded as UTF-8

so I change my code into

filename setup "/home/u63676684/template/myproject/Report/Macro/setup.sas" 
encoding='GB2312'; %include setup;

 

 

Tom
Super User Tom
Super User

Also use the SOURCE2 option so that the lines of code from the include file will appear in the SAS log.  You can change it just for this particular include by adding it as an option on the %INCLUDE statement.

%include setup / source2 ;

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 615 views
  • 0 likes
  • 3 in conversation