DATA Step, Macro, Functions and more

Proc SQL Null?

Accepted Solution Solved
Reply
Regular Contributor
Posts: 212
Accepted Solution

Proc SQL Null?

Hi. I'm trying to create a null numeric variable name Rule_Order in my Proc SQL, but I'm getting this error:

 

ERROR: The following columns were not found in the contributing tables: null

 

Can you help me to resolve this error? I'd much appreciate the help.

 

	proc sql;
	create table QueryData&ZIP5 as
	select  *,
			"A" as source, 
			"-" as rule_nm length = 58, 
			actual_dlvry_date as ad_dt, 
			null as rule_order
	from ods_iv_recon_selected_mp
	union all corresponding
	select  *,
			"B" as source, 
			"-" as rule_nm length = 58, 
			actual_dlvry_date as ad_dt, 
			null as rule_order
	from ods_bi_recon_selected_mp;
	quit;

Accepted Solutions
Solution
‎08-29-2016 06:04 PM
Super User
Posts: 10,516

Re: Proc SQL Null?

Is the varaible you want to assign the missing (SAS really doesn't speak NULL) a character or numeric in purpose?

Numeric:    . as rule_order

Character:   "" as rule_order  (best to set a length attribute for the variable if you are updating this later to avoid truncation)

View solution in original post


All Replies
Solution
‎08-29-2016 06:04 PM
Super User
Posts: 10,516

Re: Proc SQL Null?

Is the varaible you want to assign the missing (SAS really doesn't speak NULL) a character or numeric in purpose?

Numeric:    . as rule_order

Character:   "" as rule_order  (best to set a length attribute for the variable if you are updating this later to avoid truncation)

Regular Contributor
Posts: 212

Re: Proc SQL Null?

Thanks for the help!
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 1350 views
  • 1 like
  • 2 in conversation