optimizing proc print

Reply
Contributor
Posts: 39

optimizing proc print

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.

Super User
Posts: 9,681

Re: optimizing proc print

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 .

Super User
Posts: 5,256

Re: optimizing proc print

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.

Data never sleeps
Super User
Posts: 3,105

Re: optimizing proc print

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.

Ask a Question
Discussion stats
  • 3 replies
  • 286 views
  • 6 likes
  • 4 in conversation