Help using Base SAS procedures

Libname and proc contents

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Libname and proc contents

Hello,

 

I want to see the variables in a pdb.  here's my code:


libname pdb '/a/b/c/d/e/2017/0501';

proc contents data=pdb;

proc print data=pdb;

 

 

what am i doing wrong here?  please help.

 


Accepted Solutions
Solution
‎05-02-2017 01:58 PM
Super User
Super User
Posts: 6,502

Re: Libname and proc contents

You created a libref that points to a directory and then asked PROC CONTENTS to show you the variables in an unrelated WORK dataset.  If you know the member name of the dataset want then use that in the proc contents statement.

proc contents data=pdb.mydataset; run;

Or if you want to see the contetns for all of the datasets in the library then use the _ALL_ keyword.

proc contents data=pdb._all_; run;

View solution in original post


All Replies
Trusted Advisor
Posts: 1,619

Re: Libname and proc contents

We don't know what you are doing wrong, because you haven't explained what happens that you think is wrong. Perhaps you could explain what you see or don't see that is wrong, and why it is wrong.

 

 

Occasional Contributor
Posts: 12

Re: Libname and proc contents

Thank you.

 

in the log, it notes the the libref was successfully assigned, but the error noted under the proc contents says  "file.work.pdb.data does not exist".  do i need a data step?

Solution
‎05-02-2017 01:58 PM
Super User
Super User
Posts: 6,502

Re: Libname and proc contents

You created a libref that points to a directory and then asked PROC CONTENTS to show you the variables in an unrelated WORK dataset.  If you know the member name of the dataset want then use that in the proc contents statement.

proc contents data=pdb.mydataset; run;

Or if you want to see the contetns for all of the datasets in the library then use the _ALL_ keyword.

proc contents data=pdb._all_; run;
Occasional Contributor
Posts: 12

Re: Libname and proc contents

Thank you very much, Tom.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 155 views
  • 1 like
  • 3 in conversation