Questions tagged [sas-wps]
7 questions
3
votes
3 answers
'Invalid column name' error when using Proc SQL in SAS (WPS)
I am testing a very small macro which uses a Proc SQL command to extract from a SQL database. I have used this many times and understand how it works but this time it is stumping me!
%macro…

al_sweets
- 136
- 10
1
vote
1 answer
SAS - Using a loop to call a macro with different parameters
I'm new to SAS and I'm trying to automate the process of calling a macro with different parameters.
Here's the macro I want to call.
%macro expo(month, year);
data policy_&month&year;
set…

Mulloy
- 156
- 1
- 8
1
vote
0 answers
Executing stored procedure through SAS not working the same as it does in SQL Server
I have a stored procedure that I often execute within SQL Server. Without copying hundreds of lines of code into here, it basically does the following:
You enter a database and table name as parameters.
The procedure then calculates summary…

al_sweets
- 136
- 10
1
vote
1 answer
SAS: Using Weight statement in a Proc Freq command error
In SAS (through WPS Workbench), I am trying to get some frequency counts on my data using the popn field (populations as integers) as a weight.
proc freq data= working.PC_pops noprint;
by District;
weight popn / zeros;
tables AreaType…

al_sweets
- 136
- 10
0
votes
1 answer
SAS Using $ in Regex
I have a load of ID's that I want to flag if it ends in a slash and one or two digits. (/00, /01, /0)
Some ID's contain slashes in the middle that I don't want to flag.
So I want my result to be:
ID Flag
P-MTP00197854/03 …

Mulloy
- 156
- 1
- 8
0
votes
0 answers
Inserting data into SQL table from SAS dataset isn't working as expected
I am attempting to insert a SAS dataset into an existing table on a SQL Server. This is via a simple proc sql statement.
proc sql;
insert into Repo.Test_Table
select * from Work.MetaTable;
quit;
One of the fields, [Method], is not inserting…

Alex
- 3
- 2
0
votes
1 answer
How to read .wpd sas dataset in python/pyspark
Hey I am trying to import .wpd sas dataset in python.
But unable to get the solution.
Can anyone please help me out on this.
I have tried it using below class in python:
import json
import numpy as np
class JSONData:
def init(self, filename):
with…

Ashish
- 55
- 1
- 1
- 6