LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (January 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 14 Jan 2005 17:29:27 -0500
Reply-To:     "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Subject:      Data Step View. Was(Re: Dynamic method to change numeric and
              character missing value)

Hi,

About the data step views... Once you get used to the idea of a data step view, the natural next question is "can I parameterize it?" For example, the following view converts character missing values to "?"'s only for the data set, one.

/* test data */ data one; set sashelp.class; /* make some missings */ if _n_ <= 3 then do; sex = ""; age = .; height = .; end; run;

/* a data step view with a hard coded input data set name */ data missQ / view=missQ; set one; array chars _character_; do over chars; if missing(chars) then chars = repeat('?', 32767-1); end; run;

So, instead of hard coding the dataset name, we can try to put the data set name with a macro variable, instead. like:

data missQ / view=missQ; set &data; /* <-- changed */ array chars _character_; do over chars; if missing(chars) then chars = repeat('?', 32767-1); end; run;

So that we can later use this view like:

%let data=one; proc print data=missQ; run;

Or if we had a data set two, then %let data=two; proc print data=missQ; run;

Well, good idea -- I thought initially. However, it turned out that the new view (with "&data") does not compile! :-(

So, here is the open question: Can we "parameterize" data step view at all, or not?!

I have a partial answer and am hoping someone could share a more complete answer with us.

I would like to direct this question to specially for those who took and passed the base certification exam!!

(hint: http://support.sas.com/certify/samples.html)

Happy Friday!

Cheers, Chang


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