SUPPORT / SAMPLES & SAS NOTES
 

Support

Usage Note 63923: An enhancement to the SAS® system option SQLIPONEATTEMPT prevents further attempts to run a query if an error occurs while the query is running

DetailsHotfixAboutRate It

SAS/ACCESS® software takes advantage of database management system (DBMS) capabilities by passing certain SQL operations to the DBMS whenever possible. This function can reduce data movement and therefore improve performance. The performance impact can be significant when you access large DBMS tables and the SQL query that is passed to the DBMS subsets the table to reduce the number of rows. SAS/ACCESS software sends operations to the DBMS for processing in these situations.

When you use the SAS/ACCESS LIBNAME statement, you submit SAS statements that SAS/ACCESS software can often translate into the SQL of the DBMS and then pass to the DBMS for processing. With the automatic translation abilities of SAS/ACCESS software, you can often achieve performance benefits without needing to write DBMS-specific SQL code.

 

SQLIPONEATTEMPT System Option

Typically, the SQL query that SAS generates for the DBMS is highly optimized. However, in cases when SQL query generation is partial (or not optimal), the partial resulting data is read into SAS, where the remainder of the SQL query is processed. The SQLIPONEATTEMPT option specifies that if the first attempt to optimize the SQL query is not acceptable to the DBMS, no further attempts are made. Then the log shows a SQL procedure error, as shown here:

1 options SQLIPONEATTEMPT ;
2 proc sql ;
3 create table test as select * from dbms.class where put(age,roman12.) = "XII" ;
4 quit ;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time 1.60 seconds
      cpu time 0.03 seconds

You can obtain more information in the SAS log when you add the SAS system options SQL_IP_TRACE and MSGLEVEL=I, as shown here:

options sql_ip_trace=(note,source) msglevel=i;

The resulting log information looks similar to this:

NOTE: XOG: Put Ping Query
NOTE: SELECT SAS_PUTI('ROMAN', '$IS-INTRINSIC', 'en_GB', 'wlatin1') AS X, SAS_PUTI('ROMAN', '$FMT-META', 'en_GB', 'wlatin1') AS Y FROM (SELECT COUNT(*) AS C FROM CLASS WHERE 0=1) A
WARNING: The format ROMAN was not located on the database. In-database processing will proceed without it.
WARNING: ERROR: [IBM][CLI Driver][DB2/AIX64] SQL0440N No authorized routine named "SAS_PUTI" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884
SQL_IP_TRACE: pushdown attempt # 1
SQL_IP_TRACE: passed down query: select class."NAME", class."SEX", class."AGE", class."HEIGHT", class."WEIGHT" from CLASS where PUT ;
SQL_IP_TRACE: Some of the SQL was directly passed to the DBMS.

SQL_DBIDIRECTEXEC_IP_ONE_ATTEMPT Environment Variable

There might also be situations where the highly optimized SQL query is passed to the database, but an error occurs during processing. For example, an out-of-space condition occurs. In this case, SAS/ACCESS software might attempt to rewrite the query and send it partially to the database. Setting the environment variable SQL_DBIDIRECTEXEC_IP_ONE_ATTEMPT to YES or Y prevents the rewrite of the query.

The environment variable can enable you to control what happens when an execution-type error occurs. The case-sensitive environment variable can be set as follows:

options set=SQL_DBIDIRECTEXEC_IP_ONE_ATTEMPT=YES; 
options set=SQL_DBIDIRECTEXEC_IP_ONE_ATTEMPT=Y;
options set=SQL_DBIDIRECTEXEC_IP_ONE_ATTEMPT=NO;    /* default setting */
options set=SQL_DBIDIRECTEXEC_IP_ONE_ATTEMPT=N;     /* default setting */

You must also use the SAS system option DBIDIRECTEXEC. To enable the additional execution or run-time checking, use this code:

options dbidirectexec set=SQL_DBIDIRECTEXEC_IP_ONE_ATTEMPT=YES;

The SQLIPONEATTEMPT option is not required when using SQL_DBIDIRECTEXEC_IP_ONE_ATTEMPT=YES. 

Click the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASz/OS9.4_M49.4_M79.4 TS1M49.4 TS1M7
z/OS 64-bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft® Windows® for x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 8 Enterprise 32-bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 8 Enterprise x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 8 Pro 32-bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 8 Pro x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 8.1 Enterprise 32-bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 8.1 Enterprise x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 8.1 Pro 32-bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 8.1 Pro x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows 109.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows Server 20089.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows Server 2008 R29.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows Server 2008 for x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows Server 2012 Datacenter9.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows Server 2012 R2 Datacenter9.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows Server 2012 R2 Std9.4_M49.4_M79.4 TS1M49.4 TS1M7
Microsoft Windows Server 2012 Std9.4_M49.4_M79.4 TS1M49.4 TS1M7
Windows 7 Enterprise 32 bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Windows 7 Enterprise x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Windows 7 Home Premium 32 bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Windows 7 Home Premium x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Windows 7 Professional 32 bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Windows 7 Professional x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Windows 7 Ultimate 32 bit9.4_M49.4_M79.4 TS1M49.4 TS1M7
Windows 7 Ultimate x649.4_M49.4_M79.4 TS1M49.4 TS1M7
64-bit Enabled AIX9.4_M49.4_M79.4 TS1M49.4 TS1M7
64-bit Enabled Solaris9.4_M49.4_M79.4 TS1M49.4 TS1M7
HP-UX IPF9.4_M49.4_M79.4 TS1M49.4 TS1M7
Linux for x649.4_M49.4_M79.4 TS1M49.4 TS1M7
Solaris for x649.4_M49.4_M79.4 TS1M49.4 TS1M7
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.