I have defined a so to speak redefinable WORK library named W. The idea is that W is the default library for all datasets and I can change where the datasets are actually created. For example normally it's pointing to WORK but in some cases I want the datasets from the same program to persist and then I define W to point to SASUSER.
Let's say I'm creating a dataset named W.SOMEDATA. Now everything works fine when I make query block or import block. The resulting dataset in the EG process flow is shown to originate from library W no matter where W is actually pointing. But when I make a program block then EG decides that it wants to find the library where W is pointing to. And so if I had W point at WORK then the resulting dataset originates from WORK.SOMEDATA. Now when I change W to point at SASUSER and run the program the result will be SASUSER.SOMEDATA, which causes the process flow links to break.
So what I'm searching for is a way to create the dataset with program block so that it is shown to originate from library W in the process flow while W is pointing to some already existing library.
Me too.
I would like to add a file link to a text file I've exported (PROC EXPORT) so that it displays in the EG project's process flow. (like if I had used the EG export "task", anyway) I believe we're looking for similar things.
I think I see why you use this libname label, i.e. "w", I take it that using macros such as "&w" is out of the question. Continuing to threaten destruction of the system that you have already created for your purposes, what about employing the option: ?
OPTIONS USER=library;
Goodluck,
As a user of SAS in a company that can't always upgrade to the newest version immediately, I commiserate with you.
Looks like your learning SAS. Temp and permanent libraries are an important issue, and I've know I've developed out-of-the-box methods of dealing with that too.
If you're wanting to have a libname for a project that "sticks" with the project. You can create a libname in the same directory/folder of your EG project (local computer). EG provides the macro variable "_CLIENTPROJECTPATH
". If one can extract the folder URL from that then one can use that to define and create libnames, one that saves the datasets to the folder close to where the project is saved. Just in case this helps, I use this code to get that folder URL:
data _NULL_;
_CLIENTPROJECTPATH="&_CLIENTPROJECTPATH";
put _CLIENTPROJECTPATH= ;
re = prxparse("/['""]*(.*)[\\\/][^\\\/]*['""]*$/");
if PRXMATCH(re,_CLIENTPROJECTPATH) then do;
call PRXPOSN(re,1,position, length);
egp_DIR=substr(_CLIENTPROJECTPATH,position,length);
put egp_DIR=;
call symput ("egp_DIR",strip(egp_DIR));
* The macro variable should be egp_DIR is the project's parent directory/folder;
end;
run;
/* Breakdown of regular expression:*/
/****************************************/
/* / the beginning and end of the regular expression */
/* ['""]* Matches either single or double quotes and any number of those characters */
/* [\\\/] Finds one character that is either a slash \/ or back slash \\ */
/* this will be the slash charachter separating the file name and the folder path in this context.*/
/* [^\\\/]* Finds many characters that are not a character that is either a slash or back slash*/
/* in this context, this is suppoese to match the file name*/
/* .* This matches characters between the beginning of the string until the single slash character*/
/* in this context, this is the path name*/
/* (.*) The parenthese surrounding this expression identifies the matching string as a string of */
/* interest for the PRXMATCH and PRXPOSN functions.*/
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.