data new1; input id ; datalines; 1 . 1 1 ; run; data new2; input id ; datalines; 1 1 1 ; run; proc sort data=new1 ; by id; run; proc sort data=new2; by id; run; data left; merge new1 (in=a) new2 (in=b); by id; if a then output; proc print; run ; Proc sql num; Select a.*, b.* from new1 a left outer join new2 b on a.id=b.id; Quit; data left; merge new1 (in=a) new2 (in=b); by id; if b then output; proc print; run ; Proc sql num; Select a.*, b.* from new1 a right outer join new2 b on a.id=b.id; Quit;
Do not post pictures(!) of the log summary. Post the complete log text by copy/pasting it into a code box opened with the </> button.
Hi @BrahmanandaRao,
When I run your code, the error that is shown with the code in the log highlights the word num as the issue:
121 Proc sql num; ___ 22 202 ERROR 22-322: Syntax error, expecting one of the following: ;, CHECK, CODEGEN, CONSTDATETIME, DICTDIAG, DOUBLE, DQUOTE, ERRORSTOP,
Removing num allows me to run the code without an error.
Kind regards,
Amir.
It's proc sql number if you want row numbers to be displayed. There is no proc sql num.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.