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 (October 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 25 Oct 2006 08:00:27 -0400
Reply-To:     "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Subject:      Re: assign macro variable to number of columns
Comments: To: sas-l@uga.edu

Arjen wrote: > Hello SAS-L, > > I have a sas table with x columns. How would I create a macro variable > &d that represents the number x? I need to use this &d in another > macro that has the line "%do i = 1 %to &d".

Here are a few

- function %let dsid = %sysfunc(OPEN, myTable); %let D = %sysfunc(ATTRN (&dsid, NVAR)); %let rc = %sysfunc(CLOSE,&dsid);

- SQL nvar into: D from DICTIONARY.TABLES where libname= and memname= or count(*) into :D from DICTIONARY.COLUMNS where libname= and memname=

-- Richard A. DeVenezia http://www.devenezia.com/


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