Desktop productivity for business analysts and programmers

Proc SQL

Reply
New Contributor
Posts: 3

Proc SQL

[ Edited ]

data ds2d(keep=subjid patnum usubjid);

set ivdata;

set dmdata;

run;

proc sql;

create table dsdt(keep= usubjid)  as select dms.patnum dms.usubjid dms.subjid from ds2d as dms where dms.patnum=input(dms.subjid,8.);

run;

 

where condition doesn't satisfied.

 

In short, I want to set dsdt.usubjid as ds2d.usubjid where ds2d.patnum(Numeric data type) and ds2d.subjid(character datatype) must be same.

Super User
Super User
Posts: 6,845

Re: Proc SQL

[ Edited ]

napatel0911 wrote:

In short, I want to set dsdt.usubjid as ds2d.usubjid where ds2d.patnum(Numeric data type) and ds2d.subjid(character datatype) must be same.


This is what it looks like you are trying to do.

 

proc sql ;
  create table dsdt as
    select usubjid
    from ds2d 
    where patnum = input(subjid,32.)
  ;
quit;

I would describe that as finding the set of USUBJID values for the cases where the numeric PATNUM is the same as the character SUBJID.  If that is not what you are trying to do then rephrase the question to make it clearer. Posting sample input and output data will help.

 

If you are finding that there are no records that match the WHERE condition then you should post some example data that you think SHOULD match and perhaps someone can explain why it doesn't.

 

New Contributor
Posts: 3

Re: Proc SQL

Hi!! Thank you for your reply. I will post some example also asap..
Ask a Question
Discussion stats
  • 2 replies
  • 188 views
  • 1 like
  • 2 in conversation