SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

INPUT function requires a character argument

Reply
Frequent Contributor
Posts: 88

INPUT function requires a character argument

Why am I getting this error?

 

 INPUT function requires a character argument

 

Doesn't input function create numerical variables? Why is it saying that it needs a character argument?

 

Here is my code:

 

 

proc sql; 
	create table hk_dados1 as 
		select subject_id as id,
				MRN,
				BASELINE_DOC,
				COLLECTION_CENTER as site_ca,
				BASELINE_DOB,
				BASELINE_AGE,
				BASELINE_SEX,
				BASELINE_MARITALSTATUS,
				BASELINE_EDUCATION,
				BASELINE_COUNTRYORIGIN,
				BASELINE_IMMIGRATIONDATE,
				BASELINE_LANGUAGES,
				BASELINE_ENGLISH,
				BASELINE_DOA,
				BASELINE_TIMEOFINJURYSTATUS,
				BASELINE_ATTEMPTEDRETURN,
				BASELINE_CURRENTWORKING,
				BASELINE_HTN,
				BASELINE_DIABETES,
				BASELINE_MENTAL,
				BASELINE_SCORE as BASELINE_PHQ_SCORE,
				BASELINE_SMOKER,
				BASELINE_ANNOY,
				BASELINE_GUILTY,
				BASELINE_EYEOPENER,
				BASELINE_NPRSHIP,
				BASELINE_NPRSKNEE,
				BASELINE_SF1,
				BASELINE_TOTAL as BASELINE_PCS_TOTAL,
				BASELINE_WTOTALSCORE,
			    DISCHARGE_DOC,
			   	input(DISCHARGE_DC_SITE,1.) as discharge_site,
				input(DISCHARGE_STREAM,1.) as discharge_stm,
				input(DISCHARGE_HR_RECOVERING,1.) as discharge_hr_recover,
				input(DISCHARGE_HR_HELPFUL,1.)  as discharge_hr_help,
				input(DISCHARGE_HR_SATISFACTION,1.) as discharge_hr_sat,
				input(DISCHARGE_HR_GENHEALTH,1.) as discharge_hr_genhel,
				input(DISCHARGE_WTOTALSCORE, 2.) as discharge_womac_score,
				input(DISCHARGE_SCORE,2.)  as discharge_phq,
				input (DISCHARGE_NPRSHIP, 2.) as discharge_npr_bn,
				input (DISCHARGE_NPRSKNEE, 2.) as discharge_npr_kn,
				input (DISCHARGE_TOTAL, 3.) as discharge_pcs,
				DISCHARGE_RTW_STATUS
	from temp.'All$'n; 
quit;

 

 

Respected Advisor
Posts: 4,919

Re: INPUT function requires a character argument

Posted in reply to christinagting0

In your code, INPUT transforms character strings into numbers.

 

In the code

 

result = INPUT(arg1, arg2);

 

arg1 must be a character string. If arg1 is already a number, you don't need to call INPUT.

PG
Ask a Question
Discussion stats
  • 1 reply
  • 1697 views
  • 0 likes
  • 2 in conversation