Hi All,
Need help in below query. I am trying to create a macro in pass through query
proc sql;
connect to POSTGRES as ab(user="xxxx" password="abcde" );
select dim_cnt into :dimcnt from connection to ab
(select count(dimcnt) as dim_cnt from lib.tab);
disconnect from ef;
quit;
%put &dimcnt;
library connection worked but getting syntax error like below. Please help me in resolving this query
ERROR 79-322: Expecting a (.
84 disconnect from ef;
----------------------------------------------------
217
ERROR 217-322: Invalid statement due to first character being unprintable (hexadecimal representation:
C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0C2A0).
85 quit;
Unprintable character might be something that you didn't see when copy/paste from another document.
I would try deleting everything on the line before the "disconnect from ef;" If you still that error then delete everything to the semicolon on the previous line in case the offensive character(s) are appearing at the end of that line as well.
As may have been pointed out previously, the main message windows on this forum reformat text. So if you want us to actually see what was in your code or your log you need to open a text box using the </> icon above the message window and paste the text.
Please show us the ENTIRE log for this PROC SQL. Please copy the log as text and paste it into the window that appears when you click on the </> icon.
Try removing your DISCONNECT statement. Looks like it contains an unprintable character typo. SAS will disconnect automatically with the QUIT statement anyway.
Unprintable character might be something that you didn't see when copy/paste from another document.
I would try deleting everything on the line before the "disconnect from ef;" If you still that error then delete everything to the semicolon on the previous line in case the offensive character(s) are appearing at the end of that line as well.
As may have been pointed out previously, the main message windows on this forum reformat text. So if you want us to actually see what was in your code or your log you need to open a text box using the </> icon above the message window and paste the text.
'A0'x is a "non-breaking" space.
'C2A0'x is the same character in UTF-8 encoding.
Replace them with actual spaces instead. And actual space is '20'x .
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.