Hello, experts
When I try to make a simple query select and put the result into a variable on Federation Server using DS2 code, I get the following error
EG log:
ERROR: Function sequence error
ERROR: GETINTEGER for column 1 failed on result set of SQL Statement: select 1 from CDM.RTDMCDM1.CI_CAMPAIGN
Federation server log:
The code looks like this:
proc ds2; data _NULL_; method run(); dcl int output_var; dcl package sqlstmt s('SELECT 1 FROM CDM.RTDMCDM1.CI_CAMPAIGN'); output_var = s.getInt(1); end; enddata; run; quit;
Can you tell me what this error might be related to?
This problem is observed with functions like getInt, getchar, etc.
I apologise, my mistake. The problem was that I used functions incorrectly.
To make my code work, you need to add additional lines:
proc ds2; data _NULL_; method run(); dcl int output_var; dcl package sqlstmt s('SELECT 1 FROM CDM.RTDMCDM1.CI_CAMPAIGN');
s.execute();
s.fetch(); output_var = s.getInt(1); end; enddata; run; quit;
I apologise, my mistake. The problem was that I used functions incorrectly.
To make my code work, you need to add additional lines:
proc ds2; data _NULL_; method run(); dcl int output_var; dcl package sqlstmt s('SELECT 1 FROM CDM.RTDMCDM1.CI_CAMPAIGN');
s.execute();
s.fetch(); output_var = s.getInt(1); end; enddata; run; quit;
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.