BookmarkSubscribeRSS Feed
Holmes
Obsidian | Level 7

Hello guys! (Sorry for my english, not a native)

I hope someone of you helps me...

I have a query in netezza that's disconnecting me because of time of query.

 

Is there anyway to make a looping (or something else) to get first 1 million rows of this query and next 1 million rows and then on?

3 REPLIES 3
ballardw
Super User

You should include the code you are currently using for your request. That will help us have a better idea of where bottlenecks may occur.

 

You may find such things work better by creating subsets on the remote DBMS, if possible, and then transferring data to SAS.

SK_11
Obsidian | Level 7

 


data TargetTable;
do Id=1 to 10;
output;
end;
run;

 

Proc sql;
Select count(*) as count into :Count from TargetTable
;Quit;
%put &count;

%let subsetsize=3;
%let tablecount=%sysfunc(ceil(%sysevalf(&count/&subsetsize)));
%put &tablecount;


%macro createtables;
%let fo=1;
%do i=1 %to &tablecount;
data newtable&i;
set TargetTable (obs = %sysevalf(&subsetsize+&fo-1) firstobs = &fo) ;
run;
%let fo=%sysevalf(&subsetsize+&fo);
%end;
%mend;

%createtables;

 

Output:

NewTable1 NewTable2 NewTable3 NewTable4
Id Id Id Id
1 4 7 10
2 5 8  
3 6 9  

 

ballardw
Super User

This doesn't show anything related to a connection to Netezza. The transfer of data from Netezza to SAS is likely the major bottleneck. So you should likely show where in your process are bringing the data to SAS from Netezza.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 3 replies
  • 1048 views
  • 0 likes
  • 3 in conversation