- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
My below code taking 211 CPU seconds in Mainframes.I have 8 code snippets similar to below code, that needs to be run daily? any idea how can i optimize them??
ODS TAGSETS.EXCELXP BODY=HTML1
OPTIONS(SHEET_NAME='123');
PROC PRINT DATA=ABC
WHERE REGION IN ('123');
VAR var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11 var12;
FORMAT var3 var4 MMDDYY10.;
RUN;
ODS TAGSETS.EXCELXP
OPTIONS(SHEET_NAME='456');
PROC PRINT DATA=DEF
WHERE REGION IN ('456');
VAR var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11 var12;
FORMAT var3 var4 MMDDYY10.;
RUN;
ODS TAGSETS.EXCELXP CLOSE;
ODS LISTING;
And each proc print gives more that 100K observations, that variables that are included VAR condition are always same, but the data i read from is different, ABC in 1st and DEF in 2nd.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The only thing I can think to fast it is using Data Step + Put to instead of proc print .
And why not try proc export or libname + excel engine to get it . If you don't care about the style .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why would you print 100k obs?
Don't know if tagsets eats more CPU than other export techniques, try proc export/data step put and compare.
Indexing on Region might help depending on the ratio selected rows from source table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I've found that using ODS on large files is slow and uses lots of resources. If resources are an issue I would use PROC Export to get the data to Excel.