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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 298 views
  • 0 likes
  • 3 in conversation