Date: Wed, 17 Nov 2010 03:50:04 -0500
Reply-To: Mehul Shah <mehul.sas@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mehul Shah <mehul.sas@GMAIL.COM>
Subject: Fwd: proc sql
Content-Type: text/plain; charset=utf-8
Regards,
Mehul Shah
Note: The message has been sent using iphone. Please excuse the typos.
Begin forwarded message:
> From: Mehul Shah <mehul.sas@gmail.com>
> Date: November 16, 2010 11:28:31 AM EST
> To: Fatos US <fatosus@gmail.com>
> Cc: SAS-listserv <SAS-L@LISTSERV.UGA.EDU>
> Subject: Re: proc sql
>
> It should be in from statement where u r joining 2 datasets.
>
> Instead of,
>> from
>>
>> WORK.dad INNER JOIN WORK.SAMPLE ON SAMPLE.dssn = dad.id where sample.dssn ne ' ';
>
> Use following.
>
>> from
>>
>> WORK.dad INNER JOIN WORK.SAMPLE ON put(SAMPLE.dssn,comma8.0) = dad.id where sample.dssn ne ' ';
>
> Regards,
> Mehul Shah
>
> Note: The message has been sent using iphone. Please excuse the typos.
>
> On Nov 16, 2010, at 9:58 AM, Fatos US <fatosus@gmail.com> wrote:
>
>> thank you so much for your help.
>> i still have problems with the char/num variable conversion.
>> exactly where the put stmt should be located in the program?
>> within proc sql?
>> thanks again.
>> fs
>>
>>
>> proc sql;
>> put(SAMPLE.dssn,
>>
>> 9.
>> ) = dad.id;
>> create table WORK.DMATCH as
>> Select DAD.ADDRESS AS DADRES LABEL="DADRES",
>>
>> dad.fullpmad as dmadpm label="HSIS-Dad's Address",
>>
>> dad.phone1 as dmphpm label="HSIS-Dad's Phone Number",
>>
>> SAMPLE.PBCERT label='Birth Cert. Number'
>>
>> from
>>
>> WORK.dad INNER JOIN WORK.SAMPLE ON SAMPLE.dssn = dad.id where sample.dssn ne ' ';
>>
>> On Tue, Nov 16, 2010 at 9:22 AM, Mehul Shah <mehul.sas@gmail.com> wrote:
>> Fay,
>>
>> This error states that u have 2 different type of variable i.e. Dssn seems to be char however id may be numeric. U may want to convert char to numeric or vice versa for one of these variables. Try put(SAMPLE.dssn,comma8.0) = dad.id
>>
>> I hope it helps.
>>
>> Regards,
>> Mehul Shah
>>
>> Note: The message has been sent using iphone. Please excuse the typos.
>>
>> On Nov 16, 2010, at 9:06 AM, Fatos US <fatosus@GMAIL.COM> wrote:
>>
>> > Hi,
>> > Can anyone tell me what to look for to solve the sql problem below. I am
>> > trying to run someone else's program that has sql that I don't know much.
>> > Any help will be appreciated.
>> > Fay
>> >
>> >
>> > 466 create table WORK.DMATCH as
>> >
>> > 467 Select DAD.ADDRESS AS DADRES LABEL="DADRES",
>> >
>> > 468 dad.fullpmad as dmadpm label="HSIS-Dad's Address",
>> >
>> > 469 dad.phone1 as dmphpm label="HSIS-Dad's Phone Number",
>> >
>> > 470 SAMPLE.PBCERT label='Birth Cert. Number'
>> >
>> > 471 from WORK.dad INNER JOIN WORK.SAMPLE ON SAMPLE.dssn = dad.id where
>> > sample.dssn ne ' ';
>> >
>> > ERROR: Expression using equals (=) has components that are of different data
>> > types.
>> >
>> > ERROR: Expression using not equals (^=) has components that are of different
>> > data types.
>> >
>> > NOTE: The SAS System stopped processing this step because of errors.
>>
>>
>>
>> --
>> \\ - - //
>> ( @ @ )
>> +------oOOo-(_)-oOOo----------+---------------------------------+
>>
>> Amor Fati : “Love Your Fate”, which is in fact your life. ~ Friedrich Nietzsche
|