I am trying to import a MSAccess database and it's not working. I am running Windows 7 64 bit. My MS Office software is 2010. My SAS is 9.4 for 64 bit. Therefore, every piece of documentation I have found which talks about version incompatibility and offers a solution is NOT WORKING.
Here is what I've done:
1 PROC IMPORT TABLE = "Trends" DBMS = ACCESS OUT = WORK.SASTrends
REPLACE;
2 DATABASE = "C:\Users\bennetde\Documents\Trends in Early Onset
study\Trends in Early Onset
2 ! (clean).accdb";
3 RUN;
ERROR: Connect: Class not registered
ERROR: Error in the LIBNAME statement.
Connection Failed. See log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.73 seconds
cpu time 0.07 seconds
And:
4 LIBNAME libref ACCESS PATH = "C:\Users\bennetde\Documents\Trends in
Early Onset
4 ! study\Trends in Early Onset (clean).accdb";
ERROR: Connect: Class not registered
ERROR: Error in the LIBNAME statement
Please help me solve this problem so I can import my MSAccess database. Thank you.
I solved my own problem. My version of MS Office was 32 bit instead of 64 bit, which wasn't compatible for imports.
Related
Spent the last 20 hours to solve this problem, no luck. I saw a "database is locked" first in my production server when > 100 people tried to register all at once (within 10 seconds), and tried recreating it using JMeter. When I run JMeter, every time it goes beyond 5 seconds I get the "database is locked" error. So, I think I successfully recreated the problem (at least after 20 hours !!!)
Almost everyone including this piece of documentation on sqlite3 recommends that the problem stems from the 5 seconds timeout.
I tried the following:
1- I don't know the equivalent of this in flask-sqlalchemy:
engine = create_engine(..., connect_args={"options": "-c statement_timeout=1000"})
which was accepted as the correct answer here:
Configure query/command timeout with sqlalchemy create_engine?
2- This configuration doesn't have any effect:
db = SQLAlchemy(app)
db.engine.execute("PRAGMA busy_timeout=15000;")
3- This configuration, will give the following error:
app.config['SQLALCHEMY_POOL_TIMEOUT'] = 15
error:
TypeError: Invalid argument(s) 'pool_timeout' sent to create_engine(), using configuration SQLiteDialect_pysqlite/NullPool/Engine.
I am trying to run the following code
filename hw&MONDATETO pipe "zcat&WTDATADIR.MidMonthly_&DATEFROM._&DATETO..txt.gz";
but keep getting the error message:
UNOTE: The infile HW200611 is:
Unnamed Pipe Access Device,
PROCESS=zcat O:\WTData\Monthly\v4\data\MidMonthly_20061014_20061113.txt.gz,
RECFM=V,LRECL=256
Stderr output:
'zcat' is not recognized as an internal or external command,
operable program or batch file.
NOTE: 0 records were read from the infile HW200611.
NOTE: The data set WORK.HW200611 has 0 observations and 9 variables.
NOTE: DATA statement used (Total process time):
real time 0.10 seconds
cpu time 0.03 seconds
I am running SAS in batch mode on Windows 2003 server. Any help would be greatly appreciated.
Could you tell me the default location of the logs
If you are after logs generated from your SAS program that you just submitted in interactive mode to your local or remote server, it will not be saved to any physical location unless you tell it do to so (see below for how to do it). The logs will be showed in your log window (for SAS Base) or Projec Log/Step Log if your are working from SAS EG. Other SAS applications have other locations.
If you need your program log to be saved in a specific location with specific filename, you need to use PROC PRINTTO.
Let say, you have a program that puts "Hello Worlds" in to your log and you are working on unix.
Example:
PROC PRINTTO log="/home/work/log.log";
QUIT;
DATA _null_;
put "Hello World";
RUN;
/* you need to run empty PROC PRINTTO in order to direct the logs into
defaul location (your interactive session window */
PROC PRINTTO;
QUIT;
RESULT LOG printed to a file log.log:
NOTE: PROCEDURE PRINTTO used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
19
20 DATA _null_;
21 put "Hello World";
22 RUN;
Hello World
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
23
24 PROC PRINTTO;
25 QUIT;
Is it possible to avoid the use of passwords when using the SAS Metadata Batch Export Tool?
I am building a feature in my STP web app (SAS 9.2, IWA, Kerberos) for auto-exporting metadata items. As per the documentation, the ExportPackage utility requires credentials either directly (-user and -password etc options) or via a connection profile (-profile).
Logging onto the application server as sassrv, the contents of my connection profile are as follows:
#Properties file updated on: Thu Mar 12 16:35:07 GMT 2015 !!!!! DO NOT EDIT !!!!!!!
#Thu Mar 12 16:35:07 GMT 2015
Name=SAS
port=8561
InternalAccount=false
host=DEV-SASMETA.somecompany.int
AppServer.Default=A5MNZZZZ.AR000666
AllowLocalPasswords=true
authenticationdomain=DefaultAuth
SingleSignOn=true
Running my code however results in the following:
44 +%put Batch tool located at: &platform_object_path;
Batch tool located at: C:\Program Files\SAS/SASPlatformObjectFramework/9.2
45 +filename inpipe pipe
46 + " ""&platform_object_path\ExportPackage"" -profile MyProfile
47 + -package 'C:\Temp\TestPackage.spk' -objects '/SomeFolder/ARCHIVE(Folder)' -includeDep -subprop";
48 +data _null_;
49 + infile inpipe;
50 + input; putlog _infile_;
51 +run;
NOTE: The infile INPIPE is:
Unnamed Pipe Access Device,
PROCESS="C:\Program Files\SAS/SASPlatformObjectFramework/9.2\ExportPackage" -profile MyProfile -package 'C:\Temp\TestPackage.spk' -objects '/SomeFolder/ARCHIVE(Folder)' -includeDep
-subprop,
RECFM=V,LRECL=256
The export process has failed. The native implementation module for the security package could not be found in the path.
For more information, view the export log file: C:\Users\sassrv\AppData\Roaming\SAS\Logs\Export_150427172003.log
NOTE: 2 records were read from the infile INPIPE.
The minimum record length was 112.
The maximum record length was 121.
The log file was empty.
Presumably my options here are limited to:
Requesting the user password from the front end
Using a system account in the connection profile
Using a system account in the -user & -password options
??
I verified this some time ago with SAS Technical Support; it's currently not possible.
I entered a SASWare Ballet item for it: https://communities.sas.com/t5/SASware-Ballot-Ideas/Add-Integrated-Windows-Authentication-IWA-support-to-Batch/idi-p/220474
please vote!
This was initially resolved by embedding a username / password in the profile, but now it works by taking the (modified) template profile below, and adding the host= / port= parameters dynamically at runtime (so can use the same profile in different environments).
IWA is now used to connect to the metadata server!
# This file is used by Release Management for connecting to the metadata server
# The host= and port= parameters are provided by the application at runtime
SingleSignOn=true
AllowLocalPasswords=true
InternalAccount=false
SecurityPackageList=Negotiate,NTLM
SecurityPackage=Negotiate
An important thing I discovered (not in SAS documentation) is that you can substitute a profile name with an absolute path to a profile (.swa file) in the ExportPackage commmand.
Edit (one year later):
As pointed out by #Stig Eide, the error does seem to relate to 32 vs 64 bit JREs. I also came across this issue in DI Studio today and solved it by copying the sspiauth.dll files as described here
I have a program that does some math in an SQL query. There are hundreds of thousands rows (some device measurements) in an SQLite table, and using this query, the application breaks these measurements into groups of, for example, 10000 records, and calculates the average for each group. Then it returns the average value for each of these groups.
The query looks like this:
SELECT strftime('%s',Min(Stamp)) AS DateTimeStamp,
AVG(P) AS MeasuredValue,
((100 * (strftime('%s', [Stamp]) - 1334580095)) /
(1336504574 - 1334580095)) AS SubIntervalNumber
FROM LogValues
WHERE ((DeviceID=1) AND (Stamp >= datetime(1334580095, 'unixepoch')) AND
(Stamp <= datetime(1336504574, 'unixepoch')))
GROUP BY ((100 * (strftime('%s', [Stamp]) - 1334580095)) /
(1336504574 - 1334580095)) ORDER BY MIN(Stamp)
The numbers in this request are substituted by my application with some values.
I don't know if i can optimize this request more (if anyone could help me to do so, i'd really appreciate)..
This SQL query can be executed using an SQLite command line shell (sqlite3.exe). On my Intel Core i5 machine it takes 4 seconds to complete (there are 100000 records in the database that are being processed).
Now, if i write a C program, using sqlite.h C interface, I am waiting for 14 seconds for exactly the same query to complete. This C program "waits" during these 14 seconds on the first sqlite3_step() function call (any following sqlite3_step() calls are executed immediately).
From the Sqlite download page I have downloaded SQLite command line shell's source code and build it using Visual Studio 2008. I ran it and executed the query. Again 14 seconds.
So why does a prebuilt, downloaded from the sqlite website, command line tool takes only 4 seconds, while the same tool, built by me, takes 4 times longer time to execute?
I am running Windows 64 bit. The prebuilt tool is an x86 process. It also does not seem to be multicore optimized - in a Task Manager, during query execution, I can see only one core busy, for both built-by-mine and prebuilt SQLite shells.
Any way I could make my C program execute this query as fast as the prebuilt command line tool does it?
Thanks!