BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Aexor
Lapis Lazuli | Level 10

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;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

 

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

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.

Insert Log Icon in SAS Communities.png

--
Paige Miller
SASKiwi
PROC Star

Try removing your DISCONNECT statement. Looks like it contains an unprintable character typo. SAS will disconnect automatically with the QUIT statement anyway.

ballardw
Super User

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.

 

Tom
Super User Tom
Super User

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

Reeza
Super User
This type of error can happen if you copy and paste the code from a browser or formatted document to a text file.

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1397 views
  • 5 likes
  • 6 in conversation