Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to create info based on an unknown imported dataset (no clue of # and kind of variables)?

How to create info based on an unknown imported dataset (no clue of # and kind of variables)?

How to create info based on an unknown imported dataset (no clue of # and kind of variables)?


I'm facing the following 'challenge': based on *any* imported dataset with an unknown number / set of variables (by proc import, or just simply dragged into Enterprise Guide) I want to create the following information among other things (as a report or output in a dataset):
1) The number of records filled and/or blanc (OBC_ID=_n_ creates a copy of obs, always filled, so that should be an easy step in the process)
2) Per variable (presented by variable name), the total sum of all records (in case of numeric field)
3) Per variable (presented by variable name), the ratio filled records vs. blanc records, so the % of the variable name that is blanc (for numeric and character variables)

The dataset vcolumn in SASHELP contains all variables of the (random) imported set, but not the info as needed unfortunately. For this assignment, it looks like I need to create a loop in which all unknown variables are assigned to a macro, and from there the code should read out all records of the variable, so the output can be generated? Should that be a good approach? If so, how can this be done?

For example, the output has to provide me with information as presented below (all variables of the imported dataset which contains unknown variables should be present, so the dummy dataset as presented as the desired output below does contain 7 variables):

Output, based on a random imported set:

Variable name | number of records in total dataset | total sum of records | % blanc (or % filled)
Video_ID | 1600 | 1280800 | 100%
Video_ID2 | 800 | 158766 | 50%
Name | 1600 | N/A (Char) | 100%
Address | 400 | N/A (Char) | 25%
Amount | 1600 | 5500 | 100%
Date_rent | 1600 | N/A (output=sum dates) | 100%
Date_due | 1600 | N/A (output=sum dates) | 100%

How can this be done...? There's no dataset in SASHELP with such info, if I'm correct.

Thanks for your input!!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close