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 (March 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 4 Mar 2002 14:47:48 -0500
Reply-To:     "Huang, Ya" <ya.huang@PFIZER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Huang, Ya" <ya.huang@PFIZER.COM>
Subject:      Re: copy structure
Comments: To: "Fehd, Ronald J." <rjf2@CDC.GOV>
Content-Type: text/plain; charset="iso-8859-1"

Dear Ron,

It seems to me 'if 0 then set xy' not just copy the structure, it also generate one record, though all the value are missing:

------------------------------ DATA XY;X = 1;Y=2;OUTPUT;STOP; DATA YX;Y = 1;X=2;OUTPUT;STOP; DATA XYZ; if 0 then set XY;

data xyz; set xyz YX;

PROC PRINT data = XYZ;run;

proc sql; create table xyz_new like xy;

data xyz_new; set xyz_new xy;

proc print; run; -----------------------

Use proc sql create table like xxx can copy the structure and only the structure.

Regards,

Ya Huang

-----Original Message----- From: Fehd, Ronald J. [mailto:rjf2@CDC.GOV] Sent: Monday, March 04, 2002 11:31 AM To: SAS-L@LISTSERV.UGA.EDU Subject: tip: copy structure

while polishing my (in)famous 800-lb gorilla/800-line program I saw that it would make debugging immensely easier if I copied structures from the library members soon to be appended to.

DATA XY;X = 1;Y=2;OUTPUT;STOP; DATA YX;Y = 1;X=2;OUTPUT;STOP; DATA XYZ; if 0 then set XY;%*copy structure; %*(obs=0) not needed; set YX; PROC PRINT data = XYZ; RUN;

commentary?

Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov

If you think I know what I'm doing it's probably because you know even less about it. -- Pot-Shots by Ashleigh Brilliant


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