When merging 2 datasets with a common variable (not merge
key), how to keep both?

Answer Posted / reshma

data newdata;
merge dataset1 (in=a) datset2 (in=b);
if a or b;
by commonvar;
run;

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why and when do you use proc sql?

764


Which function is used to count the number of intervals between two sas dates?

576


how would you create multiple observations from a single observation? : Sas programming

572


What is your favorite all time computer book? Why?

2050


To what type of programms have you used scratch macros?

2148






What do you code to create a macro? : sas-macro

586


Hi,by usining ptf how we have to combine (likr merge)10 datasets at a time in the oracle database(and write a macro code also)?Like this i have a douts a lot if you dont mind may please send one text mail for me(madhusudhanap16@gmail.com)?

1216


what do the sas log messages "numeric values have been converted to character" mean? : Sas programming

547


What are the statements that are executed only?

676


what r the job openings SAS for fresher graduates !

2021


Explain what is data step?

733


Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX.

1782


How to limit decimal places for variable using proc means?

593


what is star schema? : Sas-di

649


How would you include common or reuse to be processed along with your statements?

1903