BookmarkSubscribeRSS Feed
109393
Calcite | Level 5

hello i am a novice in SAS and i am having problems creating a Menu in SAS. i cant access  any of my files in the path,

 

the files are being read but cannot be open once clicked on

 

 

here is the code;

libname TestMenu " \\ctstudent2\studentusers\100407385\Desktop\test";

data mru;

infile datalines dlm=',';

input recent_fullname $ :char32. recent_alias $ :char32.;

datalines;

\Desktop\test\1.plt

\Desktop\test\2.plt

\Desktop\test\3.plt

\Desktop\test\4.plt\

 

run;

proc sql noprint;

select min(count(*),10) format=1. into :mru_item_count

from mru;

%put NOTE: Found &mru_item_count. items.;

* Build a name-value paired list of macro variables;

select distinct recent_fullname, recent_alias

into: mru_recent_fullname1-:mru_recent_fullname&mru_item_count,

: mru_recent_alias1-:mru_recent_alias&mru_item_count.

from mru;

* Debug;

%put _user_;

quit;

%macro build_mru;

menu file;

%do i = 1 %to &mru_item_count.;

item "&&mru_recent_alias&i." selection=cmd&i. ;

%end;

%do i = 1 %to &mru_item_count.;

selection cmd&i. "wpgm;fileopen ""&p.\&&f&i""";

%end;

%mend build_mru;

options mprint;

proc pmenu cat=TestMenu.menus;

menu main;

item 'File' menu=file mnemonic='F';

%build_mru

run;

quit;

data _null_;

window testwindow menu=TestMenu.menus.main

#2 @10 'Hello i hope this PMENU works ';

display testwindow;

run;

 

 

 

1 REPLY 1
ballardw
Super User

You may need to show contents of your MRU data set so we can see the actual commands built.

 

Anything involving external files I always look into relative vs complete paths as a likely culprit. When defined as relative, not from the root of a drive, then that is a common problem with "not found" and such.

 

Do you get any messages in the log?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 946 views
  • 0 likes
  • 2 in conversation