LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 27 Feb 2005 22:49:38 -0800
Reply-To:     BruceBrad@INAME.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bruce Bradbury <BruceBrad@INAME.COM>
Subject:      Accessing dataset meta-data from with a datastep
Content-Type: text/plain; charset="iso-8859-1"

Is it possible to access meta-data information about a data set from within a data step?

I know it is possible to use proc sql to put variable names and the like into macro variables. However, this requires code outside the current data step which can get messy.

What I would like is a macro function %vname(n) which would return the name of the first variable in the current program data vector. (Plus similar functions for other variable attributes).

I suspect this might not be possible since the data vector doesn't get built until after the macro compilation phase. However, a good second best would be %vname(n,ds) which returned the nth variable name from data set ds. Is this possible?

Back to: Top of message | Previous page | Main SAS-L page