Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Tuning SAS Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
Vidhya Kalyanasundaram

New User


Joined: 19 Jul 2007
Posts: 30
Location: chennai

PostPosted: Wed Apr 08, 2009 11:49 am    Post subject: Tuning SAS Program
Reply with quote

Hi Friends,

I have a query regarding a SAS code. I have attached below the SAS macro that is used to extract DB2 accounting information from SAS dataset - P.SMFDB2.DATA. This step consumes around 20mins of CPU and 30 mins of Elapsed time. Is there any way to tune this program?
Code:
//R010     EXEC MXGSAS,SORT=300                                         
//SASLOG   DD  SYSOUT=*                                                 
//SASLIST  DD  SYSOUT=*                                                 
//SOURCLIB DD  DSN=SYS2.MXG.SOURCLIB,                                   
//             DISP=SHR                                                 
//WORK     DD  DSN=&&TEMPWORK,                                         
//             DISP=(,PASS),                                           
//             UNIT=(SYSDA,5),                                         
//             SPACE=(CYL,(800,250),RLSE)                               
//PDB      DD  DSN=&&TEMPPDB,                                           
//             DISP=(,PASS),                                           
//             UNIT=SYSDA,                                             
//             SPACE=(CYL,(600,50),RLSE)                               
//SYSOUT   DD  SYSOUT=*                                                 
//SYSPRINT DD  SYSOUT=*                                                 
//SMF      DD  DSN=P.SMFDB2.DATA,                                       
//             DISP=SHR                                                 
//SYSIN    DD  *                                                       
 OPTIONS NOCENTER NODATE NONUMBER;                                     
*;                                                                     
   %LET MACKEEP=                                                       
    %QUOTE(                                                             
      _NDB2                                                             
      MACRO _SDB2                 %                                     
      MACRO _WDB2ACC  PDB.DB2ACCT %                                     
      MACRO _VDB2ACC KEEP=JOB SYSTEM DB2SRBTM DB2TCBTM                 
                           QB1CGET QB2CGET QB3CGET QB4CGET             
                           QB1CRIO QB2CRIO QB3CRIO QB4CRIO %           
      MACRO _EDB2ACC                                                   
        IF QMDACNAM='BATCH' OR QMDACTYP='BATCH' THEN DO;               
        %%%INCLUDE SOURCLIB(EXDB2ACC);                                 
        END;                                                           
      %%                                                               
         )                                                             
      ;                                                                 
 %INCLUDE SOURCLIB(TYPEDB2);                                           
*;                                                                     
Back to top
View user's profile Send private message

Vidhya Kalyanasundaram

New User


Joined: 19 Jul 2007
Posts: 30
Location: chennai

PostPosted: Wed Apr 08, 2009 11:58 am    Post subject: Reply to: Tuning SAS Program
Reply with quote

Or is there any way to extract this information with any other utility which consumes less time rather than using this SAS macro?
Back to top
View user's profile Send private message
Vidhya Kalyanasundaram

New User


Joined: 19 Jul 2007
Posts: 30
Location: chennai

PostPosted: Wed Apr 08, 2009 2:58 pm    Post subject:
Reply with quote

Sorry, missed to include the SOURCLIB statements.

%%%INCLUDE SOURCLIB(EXDB2ACC);
- OUTPUT _WDB2ACC;

%INCLUDE SOURCLIB(TYPEDB2);
-
%INCLUDE SOURCLIB(VMACSMF,VMACDB2,IMACKEEP);
DATA
_VARDB2
_SMF
_CDEDB2
%INCLUDE SOURCLIB(DIFFDB2);

Could anyone please help regarding this?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Wed Apr 08, 2009 4:55 pm    Post subject:
Reply with quote

Use WHERE instead of IF statements to select your records.

Use KEEP to restrict the number of variables you're retrieving.

Contact support@mxg.com to get help -- I've found Barry Merrill to be very good at providing MXG help when needed.

Recognize, however, that DB2 can generate a large number of records in SMF and sometimes you have to bite the bullet and accept that the job is going to run for awhile.
Back to top
View user's profile Send private message
Vidhya Kalyanasundaram

New User


Joined: 19 Jul 2007
Posts: 30
Location: chennai

PostPosted: Wed Apr 08, 2009 8:59 pm    Post subject: Error
Reply with quote

I replaced the IF statement with WHERE clause as given below.

WHERE QMDACNAM='BATCH' OR QMDACTYP='BATCH' ;

But i am getting error. Could you please tell me whether my syntax is wrong?

As you said, i have sent a mail to support@mxg.com. Will post the updates in the forum.

Thanks,
Vidhya
Back to top
View user's profile Send private message
sbxjld

New User


Joined: 15 Apr 2009
Posts: 3
Location: tervuren

PostPosted: Thu Apr 16, 2009 6:50 pm    Post subject:
Reply with quote

Could you please tell me what errro you get in the log ?
Jean-Louis
Back to top
View user's profile Send private message
ABaluchamy

New User


Joined: 29 Dec 2006
Posts: 34
Location: INDIA

PostPosted: Tue Apr 21, 2009 1:01 pm    Post subject: Reply to: Tuning SAS Program
Reply with quote

I have attached the log file with this
SASLOG
Back to top
View user's profile Send private message
Vidhya Kalyanasundaram

New User


Joined: 19 Jul 2007
Posts: 30
Location: chennai

PostPosted: Tue Apr 21, 2009 9:02 pm    Post subject: Reply from Barry Merill of SAS support team
Reply with quote

Unfortunately, the _NDB2 token only prevents the OUTPUT of the
other DB2 datasets, but they are all being read and decoded.

1. You can use the IMACFILE exit to read only the SMF 101 Subtype 0 (IFCID=0003) record since you only want to create DB2ACCT.

2. You can use the IHDRDB2H "DB2 Header" exit to further select only the account records you want for batch.

You could put your code in those members of your "USERID.SOURCLIB" tailoring library, but then they would always apply if that DSNAME is used in the
//SOURCLIB concatenation, so, instead, use their "instream" equivalent macro variables:

//SYSIN DD *
%LET MACFILE=
%QUOTE (
IF ID=101 AND SUBTYPE=0;
) ;

%LET IHDRDB2H=
%QUOTE (
IF OFFQMDA GT 0 AND NRQMDA GT 0;
OFFTEST=OFFQMDA-3+OFFSMF;
INPUT @OFFTEST+41 TESTCNAM $EBCDIC8.
TESTCTYP $EBCDIC8.
@;
IF TESTCNAM='BATCH' OR TESTCTYP='BATCH';
);

the rest of your code.



But still the code is taking 25mins to process the records.

Will update further if i get reply from Barry.

Thanks !!!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Tue Apr 21, 2009 9:16 pm    Post subject:
Reply with quote

25 minutes is pretty good -- our MXG daily process takes 4.5 to 5.5 hours per day to go through all the SMF records. But then we're not looking only at one type but handling them all.
Back to top
View user's profile Send private message
Vidhya Kalyanasundaram

New User


Joined: 19 Jul 2007
Posts: 30
Location: chennai

PostPosted: Sat May 23, 2009 4:37 pm    Post subject: Cheers to the forum :-)
Reply with quote

Hi All,

With the help from SAS library and tips from Barry, i tuned the SAS macro. The CPU time got reduced from 20 mins to 5 mins !!!
Note : I have attached below the tuned code

Thanks a lot for all your help !!!!
:-)

Code:
  %LET MACFILE=                                                     
   %QUOTE(                                                         
           IF ID=101 ;                                             
           INPUT @19+OFFSMF SUBTYPE &PIB.2. @;                     
           IF SUBTYPE=0;                                           
         );                                                         
*;                                                                 
  %LET MACDB2H=                                                     
   %QUOTE(                                                         
          IF OFFQMDA GT 0 AND NRQMDA GT 0;                         
              OFFTEST=OFFQMDA-3+OFFSMF;                             
              INPUT @OFFTEST+41  TESTCNAM $EBCDIC8.                 
                                 TESTCTYP $EBCDIC8.                 
           @;                                                       
          IF TESTCNAM='BATCH' OR TESTCTYP='BATCH';                 
         );                                                         
*;                                                                 
  %LET MACKEEP=                                                     
   %QUOTE(                                                           
          _NDB2                                                     
          MACRO _SDB2                 %                             
          MACRO _WDB2ACC  PDB.DB2ACCT %                             
          MACRO _VDB2ACC KEEP=JOB SYSTEM DB2SRBTM DB2TCBTM           
                              QB1CGET QB2CGET QB3CGET QB4CGET       
                              QB1CRIO QB2CRIO QB3CRIO QB4CRIO %     
         );                                                             
*;                                                                     
 %INCLUDE SOURCLIB(TYPEDB2);                                           
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Sat May 23, 2009 5:09 pm    Post subject:
Reply with quote

Glad to hear you got the time down.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us