BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Hello,

 

Quite a while ago, I encountered an issue that has been bothering me ever since. Namely, when I run a PROC CONTENTS on a DB2-Table that has been assigned in a library certain (meta) field information is missing:

  • Number of observations
  • Last modified date,
  • Create date
  • ....

Here is a screenshot  (the blackend out parts are due to confidentiality requirements)...

Meta_missing_DB2.JPG

 

Has anybody an idea, why the metadata/dictionary tables are not filled, so that consequently the PROC CONTENTS procedure cannot retrieve any information?

 

Thx,

FK1

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Hi @FK1 - I think your last sentence hits the nail on the head. BTW it isn't very difficult to build your own utility macro to count number of observations / rows in a table so it becomes relatively easy to do.

View solution in original post

4 REPLIES 4
SASKiwi
PROC Star

Your screenshot is typical of what PROC CONTENTS can display with external database tables. For example Dataset Type and Protection have no meaning when it comes to an external database. Also for performance reasons no observation count is shown. Behind the scenes that would require a - select count(*) - query to be run which could take a long time.

 

So in summary, PROC CONTENTS is showing details that are both relevant and efficient to extract for the requested table.

FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Hello @SASKiwi,

 

thank you for your remarks. I guess the sticking point to what it boils down is the question of "relevancy". For me personally I'd consider it rather relevant to know the # of observations (just like knowing the creation date) even though it could mean loss in efficiency/speed. But of course this is just my view when talking about DB2-Tables. Since PROC CONTENTS has to deal with ANY kindy of external DBMS, I guess, this is the lowest common denominator....

 

 

SASKiwi
PROC Star

Hi @FK1 - I think your last sentence hits the nail on the head. BTW it isn't very difficult to build your own utility macro to count number of observations / rows in a table so it becomes relatively easy to do.

FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Hi @SASKiwi,

 

thank's for the hint with the utility macro. I'll just use this as a work around.

 

Cheers,

FK1

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 4 replies
  • 1157 views
  • 0 likes
  • 2 in conversation