BookmarkSubscribeRSS Feed
Nancy05
Quartz | Level 8
Here the code:


data table_list1;
set sashelp.vtable;
where libname='ELTML' and upper(memname) like 'MLT%';
run;
proc sql;
create table table_list2 as select distinct memname from sashelp.vtable where
libname='ELTML' and upper(memname) like 'MLT%';
quit;









Here the log:

1 %_eg_hidenotesandsource;
5 %_eg_hidenotesandsource;
39
40 data table_list1;
41 set sashelp.vtable;
42 where libname='ELTML' and upper(memname) like 'MLT%';
43 run;

NOTE: The query as specified involves ordering by an item that doesn't appear in its SELECT clause.
NOTE: There were 0 observations read from the data set SASHELP.VTABLE.
WHERE (libname='ELTML') and UPCASE(memname) like 'MLT%';
NOTE: The data set WORK.TABLE_LIST1 has 0 observations and 41 variables.
NOTE: DATA statement used (Total process time):
real time 1.70 seconds
user cpu time 0.40 seconds
system cpu time 1.29 seconds
memory 7570.21k
OS Memory 30492.00k
Timestamp 09/08/2016 09:14:12 AM
Step Count 11 Switch Count 40


44
45
45 ! proc sql;
46 create table table_list2 as select distinct memname from sashelp.vtable where
47 libname='ELTML' and upper(memname) like 'MLT%';
NOTE: Table WORK.TABLE_LIST2 created, with 0 rows and 1 columns.

48 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.01 seconds
user cpu time 0.00 seconds
system cpu time 0.01 seconds
memory 5203.71k
OS Memory 29536.00k
Timestamp 09/08/2016 09:14:12 AM
Step Count 12 Switch Count 34


49
50
51 %_eg_hidenotesandsource;
64
65
66 %_eg_hidenotesandsource;
69






Reeza
Super User

If both aren't working is your library assigned at the moment and can you access it?

Did it work before, I was under the impression that my code was working previously, minus the data export portion. If that was true you have an issue with your system. 

Nancy05
Quartz | Level 8
Yes. It did work before. Our test environment had a clean-up last night. All datasets I am interested disappeared.


Reeza
Super User

@Nancy05 wrote:
Yes. It did work before. Our test environment had a clean-up last night. All datasets I am interested disappeared.



Ok. So its your system and we can't help you with that. 

 

You'll need to figure out how to get your library and datasets back.  That sucks.

 

The code will work otherwise.

Reeza
Super User

@Nancy05

 

Look at your proc export code.

 

proc export data=sashelp.vtable (where=(libname="ELTML" and upper(memname) like "MLT%")

 

1. Why are you exporting that specific datasets? What's in that table?

2. What is your where clause filtering?

 

Nancy05
Quartz | Level 8

@Reeza: I did notice that there is logic error in

 

proc export data=sashelp.vtable (where=(libname="ELTML" and upper(memname) like "MLT%"))

 

@ChrisNZ version no syntax error, but logic error.

 

Your version make sense to me, but I keep getting error message.

 

By the way, I do read log message everytime after run. I can't see the value after running put str3;

 

All I can see is Capture.GIF

Reeza
Super User

@Nancy05 The logic error is that you're referencing the wrong table with the wrong WHERE clause. Review the code from my initial solution and notice what is in the Data= and Where clauses. Or Chris's solution. 

 

The SASHELP.VTABLE is a table that contains information on all the tables in your SAS System. It can be used, for example, to identify all the tables in a specific library that start with a specified prefix. However, that information isn't what you want to export. You want to export the actual tables. 

 

ChrisNZ
Tourmaline | Level 20

You are really difficult to help Nancy. Please follow the instructions.

Mine are:

1-The code you should use is in message #19.

2-You are not using it afaics. Why?

3-If it fails please post full code and log.

Or follow Reeza's instructions.

If you do not do this, no one will bother replying much longer.

You should be doing most of the work, not us. Please try harder.

 

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
  • 37 replies
  • 3278 views
  • 7 likes
  • 5 in conversation