SAS 9.3 email attachment - sas

Since upgrading to SAS 9.3, i'm only able to send emails within rsubmit, which isnt a problem... however i'm unable to attach local files, please can someone assit?
RSUBMIT;
FILENAME outmail EMAIL
SUBJECT="Daily report attached"
TO= ("xxxxx#xx.com")
ATTACH= "C:\Users\one\Desktop\Cars.xls";
DATA _NULL_;
FILE outmail;
PUT "Hello All,";
PUT ;
PUT "Please find attached the Cars report.";
PUT ;
PUT "Regards";
PUT ;
RUN;
I receive the following error message in the log:
ERROR: Error opening attachment file C:\Users\one\Desktop\Cars.xls.
ERROR: Physical file does not exist, /home/one/C:\Users\one\Desktop\Cars.xls.
Any help is much apriciated.
Thank you

Your RSUBMIT is being submitted on a server, so inside the RSUBMIT the paths are local to the server. Unless it can see your desktop (ie, via a mapped drive) it won't be able to access files on the local machine. You would have to upload them to the server first.

Related

SOAP request - SAS CI

Am trying to invoke campaign via SOAP request ,which is suppose to insert data into data warehouse,but it's not happening.am using DS2 code for it
When I try run the same campaign in test mode in SAS CI it's happening
I want the log that gets generated via SOAP request.can anyone let me know the path for the same.
Thanks in advance.
You need to check the log files on your application & mid-tier servers. Search the log files for the time you ran your request.
Start by checking the ObjectSpawner log to see if any connections were made the SAS environment at that time: ex. C:\SASHome\Lev1\ObjectSpawner\Logs

Cant read in .csv file

I am opening a new program in SAS Enterprise Guide using file -> new -> program.
Now I would like to a load .csv file from my desktop using the following code:
proc import datafile="C:\Users\M.van.der.Peet\Desktop\test.csv"
out=shoes
dbms=csv
replace;
getnames=no;
run;
proc print;
run;
When I run this I get the following error however:
ERROR: Physical file does not exist, C:\Users\M.van.der.Peet\Desktop\test.csv.
But the file is there :). Any thoughts on how I get a better understanding of why this is not working? Is there an ls() like function to see which files are stored in a dir?
If your EG session is connected to a remote SAS server (such as a Linux server) your code will not work.
Basically, when you press submit in EG, it uploads the code to the SAS server, executes the code, and downloads the results and log to the EG client. Since the remote server cannot see files on your local C: drive, you will get an error if you try to read a file on C:.
You can upload the file to the remote server, and it will work. Or if you look at the EG tasks in the menus, I'm sure there is an IMPORT task or similar name which would work. The task works by uploading the input file for you before the SAS code is submitted. I don't use the menus, so can't give you the details.
Enterprise Guide is typically installed on UNIX/Linux Server. You have to FTP the file i.e. upload the file using a FTP client like WinSCP or UltrEdit from Windows to a location on UNIX. Then you have to provide that path on your program.

SAS stored process to a web service link

I have created a SAS stored process and I need to attach it to a web service link which I intend to use it as an input in a python program .
I would really appreciate if I could get help in creating a web service from a SAS stored process .
Thank you,
Nishant
You need to create a Stored Process in SAS Management Console, and assign it to use the Stored Process Server (not Workspace Server). Ensure it has the 'streaming output' checkbox selected.
The SAS code behind this Stored Process should then send the output (that you wish to receive from your python program) to the _webout fileref, eg:
data _null_;
file _webout;
put 'Hello python!';
run;
The %stpbegin and %stpend macros should NOT be used.
To reference the Stored Process just call the URL with your Stored Process name & path in the _program parameter, as follows:
http://[yourMachineName]:8080/SASStoredProcess/do?_PROGRAM=/Your/MetadataPath/YourSTPName
Easiest is to use the SAS Stored Process Web App. It allows you to call a stored process via URL. You should read (http://support.sas.com/documentation/cdl/en/stpug/68399/HTML/default/viewer.htm#n0mbwll43n6sw3n1jhcfnx51i8ze.htm).
From there, use the Python requests library.

Proc http with https url

So, I want to use Google Url shortener Api, and I try to use
proc http
so, when I run this code
filename req "D:\input.txt";
filename resp "D:\output.txt";
proc http
url="https://www.googleapis.com/urlshortener/v1/url"
method="POST"
in=req
ct="application/JSON"
out=resp
;run;
(where D:\input.txt looks like {"longUrl": "http://www.myurl.com"} ) everything works greate on my home SAS Base 9.3. But, at work, on EG 4.3, I get:
NOTE: The SAS System stopped processing this step because of errors.
and no possible to debug. After googling, I found, that I have to set java system option like this
-jreoptions (-Djavax.net.ssl.trustStore=full-path-to-the-trust-store -Djavax.net.ssl.trustStorePassword=trustStorePassword)
But, where I can get "the certificate of the service to be trusted"- and password to it?
Edit: As I noticed in comments below, my work SAS installed into server, so I didn't have direct access to configuration. Also, It isn't good idea to change servers config. So, I try to google more, and found beautiful solution using cUrl, without X command (cause it block in my EG). Equivalent syntax is:
filename test pipe 'curl -X POST -d #D:\input.txt https://www.googleapis.com/urlshortener/v1/url --header "Content-Type:application/json"';
data _null_;
infile test missover lrecl= 32000;
input ;
file resp;
put _infile_;
run;
Hope it help someone
Where to get the certificate
Open the URL that you want the certificate from via Chrome. Click on the lock file in the URL bar, click on "details" tab and then click on "Save as file" in the bottom right. You will need to know what trust store you are going to use at this stage. See the following step.
The password and trust store is defined by you. It is in most cases nothing more than an encrypted zip file. There are a lot of tools out there that allow you to create a trust store, encrypt it and then import the certificates into it. The choice will depend on what OS you are using. There are some java based tools that OS independent, for example Portecle. It allows to define various trust stores on different OS and you can administer them remotely.
Regards,
Vasilij

Coldfusion MX7 error with file upload

I am using coldfusion mx7 server. While upload an excel file with(97-2003) format, I am getting the following error:
Unable to construct record instance, the following exception occured: null
I am getting this error when I enters some data and save in my desktop with the format(97-2003) and after using a cfx tag to dump the uploaded data, I am getting this error. But if I just upload the template only without entering any data it will shows/dump the column name in template
Is there any way to upload the same excel file with MX7?
Thanks in advance
Are you protecting the sheet/workbook after you enter data? Try without it. Also what OS is the CFMX 7 on?