BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Patrick
Opal | Level 21

Hi all,

 

Using SAS EG while populating and then printing a control table with some test data I've encountered a case where the data messes-up the output (sample below).

Do you know of any way to avoid such a result without having to encode characters in the source data so they become "html safe"?

data work.sample;
  infile datalines4 truncover dlm='|' dsd;
  input
    rule_type :$30.
    rule_desc :$100.
    ;
  datalines4;
Not Null|Raise issue if value is missing
In a List|Raise issue if value NOT found in a list
Not In a List|Raise issue if value found in a list
In Value Range|Raise issue if value NOT within boundaries
Not In Value Range|Raise issue if value within boundaries
Lookup Exist|<table for hash> <keyvar(s) hash> <keyvar(s) table if different names>
Not Lookup Exist|<table for hash> <keyvar(s) hash> <keyvar(s) table if different names>
Unique Key|<space separated list of variables that make up the unique key>
Custom Function|Any SAS expression that return True or False. Example: <var 1> = <var 2>
;;;;

proc print data=work.sample;
run;

Patrick_0-1674287115095.png

Thanks,

Patrick

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Patrick,

Try this one.

 

data work.sample;
  infile datalines4 truncover dlm='|' dsd;
  input
    rule_type :$30.
    rule_desc :$100.
    ;
  datalines4;
Not Null|Raise issue if value is missing
In a List|Raise issue if value NOT found in a list
Not In a List|Raise issue if value found in a list
In Value Range|Raise issue if value NOT within boundaries
Not In Value Range|Raise issue if value within boundaries
Lookup Exist|<table for hash> <keyvar(s) hash> <keyvar(s) table if different names>
Not Lookup Exist|<table for hash> <keyvar(s) hash> <keyvar(s) table if different names>
Unique Key|<space separated list of variables that make up the unique key>
Custom Function|Any SAS expression that return True or False. Example: <var 1> = <var 2>
;;;;

proc report data=work.sample nowd style(column)={PROTECTSPECIALCHARS=yes};
run;

Ksharp_0-1674312062715.png

 

View solution in original post

1 REPLY 1
Ksharp
Super User

Patrick,

Try this one.

 

data work.sample;
  infile datalines4 truncover dlm='|' dsd;
  input
    rule_type :$30.
    rule_desc :$100.
    ;
  datalines4;
Not Null|Raise issue if value is missing
In a List|Raise issue if value NOT found in a list
Not In a List|Raise issue if value found in a list
In Value Range|Raise issue if value NOT within boundaries
Not In Value Range|Raise issue if value within boundaries
Lookup Exist|<table for hash> <keyvar(s) hash> <keyvar(s) table if different names>
Not Lookup Exist|<table for hash> <keyvar(s) hash> <keyvar(s) table if different names>
Unique Key|<space separated list of variables that make up the unique key>
Custom Function|Any SAS expression that return True or False. Example: <var 1> = <var 2>
;;;;

proc report data=work.sample nowd style(column)={PROTECTSPECIALCHARS=yes};
run;

Ksharp_0-1674312062715.png

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 272 views
  • 1 like
  • 2 in conversation