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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.