BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buechler66
Barite | Level 11

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;
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

2 REPLIES 2
ballardw
Super User

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)

buechler66
Barite | Level 11
Thanks for the help!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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