1 data credit;
2 input x1-x20;
3 x1 = checking x2 = duration x3 = history x4 = purpose x5 = amount x6 = savings x7 = employ x8 = rate x9 = status
-- -- -- -- --
22 22 22 22 22
3 x1 = checking x2 = duration x3 = history x4 = purpose x5 = amount x6 = savings x7 = employ x8 = rate x9 = status
--
22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, ;, <, <=, <>, =, >, ><, >=, AND, EQ, GE,
GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, [, ^=, {, |, ||, ~=.
What are you trying to accomplish? Hard to tell from the code you posted.
Art, CEO, AnalystFinder.com
i am using proc discim and proc factors to compute german credit datasets.
I'll restate my question: what were you trying to accomplish with the code you posted? e.g. I was trying to create a dataset called ZZ that had X records, each with Y variables, that contained the following values: xxx, yyy, zzz
Art, CEO, AnalystFinder.com
i was trying to work on datasets called german credit. it contains 20 x - variables and y response variable called good_bad. my sas procedure are proc discrim and proc factors.
Sorry, but in the code you posted there is not the faintest trace of these procedures. Your code just contains a syntactically wrong datastep, the purpose of which is not clear at all.
@ojoseph wrote:
i was trying to work on datasets called german credit. it contains 20 x - variables and y response variable called good_bad. my sas procedure are proc discrim and proc factors.
So, are you trying to manipulate data that is already present in a SAS dataset, or are you trying to read external (non-SAS) data into a dataset for further processing?
Please seep the following links for video tutorials for basic tasks, and the free programming course.
If you're not a programmer consider using the tasks.
Support.sas.com/training/tutorial
It is also very important to know your environment. Are you using SAS University Edition, or a licensed SAS installation? If it is the latter, is it single machine, or client/server? And which operating system(s) is/are involved?
If you just want to make your output easier to read then perhaps you just need to add a LABEL statement to your PROC call?
proc discrim data=german_credit;
var x1-x20 ;
label x1='Checking' x2='Duration' .... ;
run;
I see an input statement, but I see nothing that could provide data for the input (infile or cards/datalines).
Then I see several assignments to variables that were just used in the input statement, but those assignment statements are not properly separated by semicolons, and cause a syntax error message. So I have to repeat @art297's question: what are you trying to do in this data step? (Hint: your first answer to his question was not helpful at all)
What format is your source data? Is it a text file, like a CSV or other delimited file?
Looks like you might be trying to read variables using dummy names like X1,X2 etc and then rename to to more meaningful names.
If you want to rename the use the RENAME statement (or dataset option).
rename
x1 = checking
x2 = duration
x3 = history
x4 = purpose
x5 = amount
x6 = savings
x7 = employ
x8 = rate
x9 = status
;
Or better just read the variable using the names you want to begin with.
data want ;
infile 'myfile.csv' dsd truncover firstobs=2;
input checking duration history purpose amount savings
employ rate status
;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.