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 (May 2004, 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 May 2004 14:51:32 -0400
Reply-To:     harry.droogendyk@RBC.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Harry Droogendyk <harry.droogendyk@RBC.COM>
Subject:      Re: missing value column in proc sql
Content-Type: text/plain; charset=iso-8859-1

Susan:

SQL has a CASE statement that'll be helpful:

proc sql; create table b as select acct, case cnt when ' ' then '*' else cnt end as cnt from a ; quit;

-----Original Message----- From: susan bander [mailto:sbander@CNN.COM] Sent: Friday, May 14, 2004 2:32 PM To: SAS-L@LISTSERV.UGA.EDU Subject: missing value column in proc sql

how do I do this correctly? trying to add missing value items as separate column or can I replace them in place with a value?

sample (with some non-working sas... :))

data a; input acct cnt $ junk;cards; 1 . 0 1 x 1 1 . 0 5 x 0 5 . 0 5 x 0 run;

*normally I would do; /*data a;set a;if cnt=" " then cnt="*";*/

*how would this look in proc sql?; *the goal is to do something like this;

proc sql; create table b as select a.* , ( select missing(cnt) with "*" if the value is missing ) ; quit;

------------------------------------------------------------This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.

Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.

============================================================


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