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.
Related
I want to read part of a very very large compressed file(119.2 GiB if decompressed) with this piece of code.
FILE* trace_file;
char gunzip_command[1000];
sprintf(gunzip_command, "gunzip -c %s", argv[i]); // argv[i]: file path
trace_file = popen(gunzip_command, "r");
fread(¤t_cloudsuite_instr, instr_size, 1, trace_file)
Does popen in c load whole output of the command into memory? If it does not, does popen save the the whole output of the command in a tmp file(in disk)? As you can see, the output of decompressing will be too large. Neither memory nor disk can hold it.
I only know that popen creates a pipe.
$ xz -l 649.fotonik3d_s-1B.champsimtrace.xz
Strms Blocks Compressed Uncompressed Ratio Check Filename
1 1 24.1 MiB 119.2 GiB 0.000 CRC64 649.fotonik3d_s-1B.champsimtrace.xz
I only know that popen creates a pipe.
There are two implementations of pipes that I know:
On MS-DOS, the whole output was written to disk; reading was then done by reading the file.
It might be that there are still (less-known) modern operating systems that work this way.
However, in most cases, a certain amount of memory is reserved for the pipe.
The xz command can write data until that amount of memory is full. If the memory is full, xz is stopped until memory becomes available (because the program that called popen() reads data).
If the program that called popen() reads data from the pipe, data is removed from the memory so xz can write more data.
When the program that called popen() closes the file handle, writing to the pipe has no more effect; an error message is reported to xz ...
I am getting issue in SAS while executing the SAS job , getting error "Retrieving login information based on AuthenticationDomain from the SAS Metadata Server failed" My tables are in teradata server. please guide me.
Here I'm posting some piece of log file code, which I believe interpret the issue.
NOTE: CALL EXECUTE routine executed successfully, but no SAS statements were generated.
MPRINT(ETLS_GETPARAMETERS): ;
MPRINT(ETLS_PROCESSTOLOOPWPM8XG): ;
Process ID: 31002
MPRINT(ETLS_JOBWPM8XQ): options metaport = 8560 metaserver = "xxxl01010.xxxxxx.com.au";
MPRINT(ETLS_SETDEBUG): OPTIONS MPRINT;
MPRINT(ETLS_JOBWPM8XQ): ;
MPRINT(ETLS_JOBWPM8XQ): LIBNAME TDST1V TERADATA SERVER="xxxx8.xxxxxxx.xxx.xx" SCHEMA=IUSIT02_STG_ED_VIEW AUTHDOMAIN="Teradata
Auth" ;
NOTE: Libref TDST1V was successfully assigned as follows:
Engine: TERADATA
Physical Name: xxxx8.xxxxxxxx.com.XX
MPRINT(ETLS_JOBWPM8XQ): ;
MPRINT(ETLS_JOBWPM8XQ): options comamid=TCP;
MPRINT(ETLS_JOBWPM8XQ): data _null_;
MPRINT(ETLS_JOBWPM8XQ): signon AuthDomain="DefaultAuth" noscript;
ERROR: Retrieving login information based on AuthenticationDomain from the SAS Metadata Server failed.
ERROR: Remote signon canceled.
MPRINT(ETLS_JOBWPM8XQ): run;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 352.59k
OS Memory 13464.00k
Timestamp 15/03/2017 02:39:09 AM
Step Count 84 Switch Count 55
Page Faults 0
Page Reclaims 9
Page Swaps 0
Voluntary Context Switches 209
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
140 The SAS System 02:01 Wednesday, March 15, 2017
MPRINT(ETLS_JOBWPM8XQ): data _null_;
MPRINT(ETLS_JOBWPM8XQ): if 9.4 ge 9 then rmtname = "/ remote = local";
MPRINT(ETLS_JOBWPM8XQ): else rmtname = "";
MPRINT(ETLS_JOBWPM8XQ): call execute('%syslput job_rc = &job_rc '||rmtname||';');
MPRINT(ETLS_JOBWPM8XQ): call execute('%syslput trans_rc = &trans_rc '||rmtname||';');
MPRINT(ETLS_JOBWPM8XQ): call execute('%syslput sqlrc = &sqlrc '||rmtname||';');
MPRINT(ETLS_JOBWPM8XQ): call execute('%syslput syscc = &syscc '||rmtname||';');
MPRINT(ETLS_JOBWPM8XQ): call execute('%syslput etls_stepStartTime = &etls_stepStartTime'||rmtname||';');
MPRINT(ETLS_JOBWPM8XQ): call execute('run;');
MPRINT(ETLS_JOBWPM8XQ): run;
ERROR: A link must be established by executing the SIGNON command before you can communicate with LOCAL.
ERROR: A link must be established by executing the SIGNON command before you can communicate with LOCAL.
ERROR: A link must be established by executing the SIGNON command before you can communicate with LOCAL.
ERROR: A link must be established by executing the SIGNON command before you can communicate with LOCAL.
ERROR: A link must be established by executing the SIGNON command before you can communicate with LOCAL.
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.
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;
I have a strange problem with my SAS base ETL program. The program runs perfectly fine in the program editor of SAS base, but it aborts in batch mode. I'm currently debugging the entire code and I came at the following problem. I'm using an infile statement to read a txt file from a certain location.
When I run the program in the program editor mode, the infile statement runs perfectly and the dataset reads the right amount of data. But when the program runs in the batch mode, it seems like the infile statement is completely ignored. The datasets reads nothing and remains empty with 0 observations.
Here is the code with the log:
DATA odd.mailables_&monthcode.;
length id_account 8
language_id $2
zip $4;
infile &file_name. delimiter='09'x firstobs=2 dsd pad missover end=last;
load_date_time=datetime();
if _n_=1 then
do;
call symputx ('start_load_date_time', load_date_time);
end;
format load_date_time datetime20.;
monthcode="&monthcode.";
input id_account
language_id $
zip $;
if last then
do;
call symputx ('end_load_date_time', load_date_time);
end;
RUN;
proc sort data=odd.mailables_&monthcode.;
by id_account;
run;
This is the log afterwards:
SYMBOLGEN: Macro variable FILE_NAME resolves to "D:\mailables.txt"
"D:\mailables.txt"
SYMBOLGEN: Macro variable MONTHCODE resolves to 20150506
SYMBOLGEN: Macro variable FILE_NAME resolves to "D:\mailables.txt"
SYMBOLGEN: Macro variable MONTHCODE resolves to 20150506
NOTE: The data set ODD.MAILABLES_20150506 has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
Memory 141k
OS Memory 7864k
Timestamp 8/05/2015 14:32:50
SYMBOLGEN: Macro variable MONTHCODE resolves to 20150506
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
Memory 33k
OS Memory 7864k
Timestamp 8/05/2015 14:32:50
Is there a difference between the batch mode and the program editor mode in the way it reads the code or in the syntax you need to use?
Thanks for the information
A standard debugging technique is to reduce the code to the smallest simplest piece possible which still causes an error. Try running this, and see if there's a difference in output between Program Editor and batch.
data _null_;
infile 'D:\mailables.txt';
input;
put _infile_;
run;
(Sorry, only allowed to answer, not comment.)