DATA Step, Macro, Functions and more

Stuck on syntax

Reply
Regular Contributor
Posts: 212

Stuck on syntax

[ Edited ]

I have the following Case statements:

 

					CASE 
						WHEN %scan(&rule_list, 1,#) AND a.RULEFLAG = "-" THEN "&RULE_ORDER"
						WHEN %scan(&rule_list, 2,#) AND a.RULEFLAG = "-" THEN "&RULE_ORDER"
					END as RuleFlag

The resolution of %scan(&rule_list,1,#) may look like this:  

 

A.ACTUAL_DLVRY_DATE IS NULL AND B.ACTUAL_DLVRY_DATE IS NOT NULL

 

My problem is that I need it to resolve with parentheses around the value.  Like this:

 

(A.ACTUAL_DLVRY_DATE IS NULL AND B.ACTUAL_DLVRY_DATE IS NOT NULL)

 

Any help would be greatly appreciated.

Super User
Posts: 10,500

Re: Stuck on syntax

I think you need to have quotes around the # in the scan.

 

Have you tried:

when (%scan(&rule_list, 1,"#"))

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