Recently in the SAS Community Library: SAS' @Sundaresh1 highlights a sometimes overlooked task when applying document embeddings for purposes of similarity-based search. Normalisation of vectors helps obtain relevant matches.
Hi, I am new to SAS and I am trying to input data from the a .txt file. Could someone please help me figure out why the IF-THEN statement only applies to the first row of the data? Thanks! Data: DATA work.condo_ranch;
INFILE '/home/u63748921/SAS 123 Problems/sas123_p13.txt' DSD;
INPUT style $ @;
IF style = 'RANCH' OR style = 'CONDO' THEN INPUT sqfeet bedrooms baths street $ price : dollar10.;
RUN; Output:
... View more
As I recently posted here, I'm trying to create Table 1 for a research journal article. @Reeza pointed me to the Table 1 macro "TableN" and it looks like exactly what I need.
I downloaded the macro and ran it, and then I tried to call it based on the example provided.
/*Example macro call*/
/*%tablen(data=example, by=arm,
var=age date_on sex race1 smoke_st num_met,
type=1 3 2, outdoc=~/ibm/example1.rtf);*/
/*My version*/
%tablen(data=have, by=TM_group,
var=DEM_AGE DEM_SEX,
type=2 2, outdoc="C:\data_output\test.rtf);
But I got an error after "by TM_group": ERROR: All positional parameters must precede keyword parameters. I looked up the error and it has something to do with the commas between the parameters. After some trial and error of deleting commas, I got it to run without error, but it doesn't produce any output.
Sample data is provided below:
data have;
infile datalines dsd dlm=',' truncover;
input DEM_AGE DEM_SEX cohort_flag TM_group;
datalines;
3,1,1,0
2,1,1,1
3,2,1,1
3,2,1,1
3,2,1,0
2,2,1,1
2,1,1,1
3,1,1,1
2,1,1,1
3,2,1,0
2,1,1,0
2,2,1,1
3,2,1,0
2,2,0,
3,2,1,1
3,2,1,1
3,1,1,0
3,2,1,0
2,1,1,0
3,1,1,1
3,2,1,1
3,2,1,0
3,2,1,1
3,2,1,1
3,2,1,1
; RUN;
proc format library=temp;
value age2grp
1='1:Age Group <65'
2='2:Age Group [65,75)'
3='3:Age Group >=75'
.='Inapplicable/Missing';
value sex
.='Inapplicable/Missing'
1='1:Male'
2='2:Female'
value yesfmt
1='1:Yes'
2='2:No'
.='Inapplicable/Missing'
;
RUN;
... View more
Hi, I have 2 data sets like below. Data one A 1 A 2 B 1 B 2 Data two A Apple A Peach B Banana I need to join them (Cartesian join), but only join by ID (A and B). This is what I want to get: A 1 Apple A 1 Peach A 2 Apple A 2 Peach B 1 Banana B 2 Banana If I use the below code, proc sql; create table three as select one.* ,two.* from one ,two; quit; What I have got was A 1 Apple A 1 Peach A 1 Banana A 2 Apple A 2 Peach A 2 Banana B 1 Apple B 1 Peach B 1 Banana B 2 Apple B 2 Peach B 2 Banana Is there any way to only join by the ID (A, B)? Thank you very much!
... View more
refer to an old post below. i searched , but can't find any sample program. can anyone post a specific link for sample program? thanks. Solved: Nonmem Program - SAS Support Communities
... View more