sas

How to call a SAS STP in background using proc http and http_tokenauth

别等时光非礼了梦想. 提交于 2020-08-27 22:06:28
问题 I'm trying to call a stored process (STP) from SAS via proc http using the option background, to ensure that my main process does not wait for the STP to be finished. I do use the following code: filename resp "<path to response file>"; %let url = https://<ServerName>:<port>/SASStoredProcess/do; %let question_mark = ?; proc http url="%str(&url.)&question_mark.%nrstr(_action=background&_program=<path to STP>&num1=11&num2=22)" out=resp http_tokenauth; HEADERS "Content-Type"="application/x-www

adding a meta user to a meta group in sas

泄露秘密 提交于 2020-08-26 04:53:19
问题 I've around 600 meta users in SAS EGRC 6.1 in the platform in SAS 9.4. I want to add those users to a meta-group. for this, I'm using code below libname current '/tmp/temp1'; /* for the current metadata */ libname addgrps '/tmp/temp2'; /* current augmented with the changes */ libname updates '/tmp/temp3'; /* for the updates created by the mducmp macro */ options metaserver=abc metaport=8561 metauser='sasadm@saspw' metapass='xyz123' metaprotocol=bridge metarepository=foundation; %mduextr

I want to add auto_increment column in a table in SAS

£可爱£侵袭症+ 提交于 2020-07-09 03:55:21
问题 I want to add a auto_Increment column in a table in SAS.Following code add's a column but not increment the value. Thanks In Advance. proc sql; alter table pmt.W_cur_qtr_recoveries add ID integer; quit; 回答1: Wow, going to try for my second "SAS doesn't do that" answer this morning. Risky stuff. A SAS dataset cannot define an auto-increment column. Whether you are creating a new dataset or inserting records into an existing dataset, you are responsible for creating any increment counters (ie

I want to add auto_increment column in a table in SAS

痴心易碎 提交于 2020-07-09 03:55:04
问题 I want to add a auto_Increment column in a table in SAS.Following code add's a column but not increment the value. Thanks In Advance. proc sql; alter table pmt.W_cur_qtr_recoveries add ID integer; quit; 回答1: Wow, going to try for my second "SAS doesn't do that" answer this morning. Risky stuff. A SAS dataset cannot define an auto-increment column. Whether you are creating a new dataset or inserting records into an existing dataset, you are responsible for creating any increment counters (ie

Put/print mean of a variable to log in SAS

眉间皱痕 提交于 2020-06-17 03:55:10
问题 How do i print the mean of a variable to the log in SAS? data fruit; input zip fruit & $22. pounds; datalines; 10034 apples, grapes kiwi 123456 92626 oranges 97654 25414 pears apple 987654 ; This is what I've tried: data _null_; set fruit; put mean(zip); run; 回答1: You can use PROC SQL. proc sql noprint; /*noprint as you don't want to print to the defined output location, just the log*/ /*format, formats the value. into :<> puts the value into a macro variable named <>*/ select mean(zip)

Read SAS sas7bdat data with Spark

与世无争的帅哥 提交于 2020-06-16 11:53:06
问题 I have a SAS table and I try to read it with Spark. I've try to use this https://github.com/saurfang/spark-sas7bdat like but I couldn't get it to work. Here is the code: from pyspark.sql import SQLContext sqlContext = SQLContext(sc) df = sqlContext.read.format("com.github.saurfang.sas.spark").load("my_table.sas7bdat") It returns this error: Py4JJavaError: An error occurred while calling o878.load. : java.lang.ClassNotFoundException: Failed to find data source: com.github.saurfang.sas.spark.

Running SAS EG project with Python

*爱你&永不变心* 提交于 2020-06-16 06:58:09
问题 I've searched a bit for a way to execute a SAS Enterprise Guide project and its programs via Python but I could not find anything. I only find SAS examples like the question: How do I invoke a sas script in python? I can call the enterprise guide project as my sysin like the answer in that link suggested, but when the project opens it tries to import all the other parameters I passed. I also can't find the path for each individual SAS program as it is inside the project. Does anyone knows a

Read SAS file with pandas

谁说我不能喝 提交于 2020-06-12 18:07:51
问题 I'm trying to use the pandas read_sas() function. First, I create a SAS dataset by running this code in SAS: libname tmp 'c:\temp'; data tmp.test; do i=1 to 100; x=rannor(0); output; end; run; Now, in IPython, I do this: import numpy as np import pandas as pd %cd C:\temp pd.read_sas('test.sas7bdat') Pretty straightforward and seems like it should work. But I just get this error: TypeError: read() takes at most 1 argument (2 given) What am I missing here? I'm using pandas version 0.18.0 . 回答1:

What does “variable = .” (variable = dot) mean in Oracle SQL/SAS?

一曲冷凌霜 提交于 2020-06-08 12:30:08
问题 I am converting a SAS script to Python, where the SAS script was interfacing with an Oracle database, and the Python will be interfacing with a PostgreSQL database. In the SAS code, I found this statement: proc sql noprint; create table table_name as select distinct wtn from another_table where account = . ; What does "where account = ." mean in Oracle? Or is it not an Oracle SQL thing, and instead is a SAS thing? Or is it available in all forms of SQL? Further, if it is SAS and/or Oracle