Date: Mon, 15 Sep 2003 12:15:21 -0700
Reply-To: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject: Re: merge
Content-Type: text/plain; charset="iso-8859-1"
Neal-
Good point (pun intended). The stop _is_ needed if all of the datasets read
by the datastep set statements use the point= option. If you are reading at
least one without the point= then when the end of that dataset is reached an
implied stop is executed, as in my example.
It's probably good practice to include an explicit stop.
Paul Choate
DDS Data Extraction
-----Original Message-----
From: Nair, Neal K (ACF) [mailto:nnair@acf.hhs.gov]
Sent: Monday, September 15, 2003 12:04 PM
To: 'Choate, Paul@DDS'
Subject: RE: merge
The SAS manual says (SAS Language Reference, Vol. 2, p1012), when using
POINT= variable, a STOP statement is required - to prevent endless looping.
Do you agree?
Thanks.
Neal
-----Original Message-----
From: Choate, Paul@DDS [mailto:pchoate@DDS.CA.GOV]
Sent: Monday, September 15, 2003 3:00 PM
To: Nair, Neal K (ACF); 'SAS-L@LISTSERV.UGA.EDU'
Subject: RE: merge
Sorry, the pointer required a variable
Try:
data c;
I=1;
set a;
set b point=I
run;
It will drop I automatically because SAS defines the pointer as it is
temporary.
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: Nair, Neal K (ACF) [mailto:nnair@acf.hhs.gov]
Sent: Monday, September 15, 2003 11:27 AM
To: 'Choate, Paul@DDS'; SAS-L@LISTSERV.UGA.EDU
Subject: RE: merge
I tried Paul's program below (copied and pasted), but it did not run
properly. The SAS log says Error 22 (under point=1): Expecting a name. [I
am using Windows, SAS 8.2].
Any explanation for this, please?
Neal
-----Original Message-----
From: Choate, Paul@DDS [mailto:pchoate@DDS.CA.GOV]
Sent: Wednesday, September 10, 2003 11:17 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: merge
A similar method to Bruce's using KrzysOPoranku's suggestion of "point=1" to
hold the single z observation.
data a;
input x $ y $;
cards;
1 2
2 2
3 5
2 4
3 3
;
run;
data b;
input z $;
cards;
6
;
run;
data c;
set a;
set b point=1;
run;
proc print data=c;
run
Paul Choate
DDS Data Extraction
-----Original Message-----
From: Bruce Johnson [mailto:bjohnson@SOLUCIENT.COM]
Sent: Wednesday, September 10, 2003 7:47 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: merge
Try this. A SET is what you need, not a merge...
data a;
input x $ y $;
cards;
1 2
2 2
3 5
2 4
3 3
;
run;
data b;
input z $;
cards;
6
;
run;
data c;
set a;
if _n_=1 then set b;
run;
proc print data=c;
run;
________________________________
Bruce A. Johnson
bjohnson@solucient.com
-----Original Message-----
From: Fred [mailto:F79redo@YAHOO.FR]
Sent: Wednesday, September 10, 2003 4:42 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: merge
Hi,
I have a problem.
Could someone help me please?
I have 2 datas like these:
Data A Data B
X | Y Z
------ -
1 | 2 6
2 | 2
3 | 5
2 | 4
3 | 3
With a merge, I obtain:
Data C
X | Y | Z
----------
1 | 2 | 6
2 | 2 | .
3 | 5 | .
2 | 4 | .
3 | 3 | .
But I wish:
X | Y | Z
----------
1 | 2 | 6
2 | 2 | 6
3 | 5 | 6
2 | 4 | 6
3 | 3 | 6
How can I make it?
Thank you.
Frédéric PAILLE
This message is a private communication. It may contain information that is
confidential and legally protected from disclosure. If you are not an
intended recipient, please do not read, copy or use this message or any
attachments, and do not disclose them to others.
Please notify the sender of the delivery error by replying to this message,
and then delete it and any attachments from your system. Thank you.
Solucient LLC.