BookmarkSubscribeRSS Feed
napatel0911
Calcite | Level 5

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.

2 REPLIES 2
Tom
Super User Tom
Super User

@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.

 

napatel0911
Calcite | Level 5
Hi!! Thank you for your reply. I will post some example also asap..

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 774 views
  • 1 like
  • 2 in conversation