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

Hi all, 

 

I'm sure there must be a simple answer but right now throwing a blank. 

How do I use DSD but also instruct SAS to read the data "as-is" without ever removing quotes.

 

In below sample what do I need to change so variable snippet stores the value 'alfred' in quotes?

data control.rule_instances;
  attrib
    rule_type length=$30  informat=$30.
    libref    length=$8   informat=$8.
    table     length=$32  informat=$32.
    column    length=$32  informat=$32.
    snippet   length=$500 informat=$500.
    ;

  infile datalines4 dsd truncover dlm='|';
  input
    rule_type
    libref   
    table    
    column   
    snippet  
    ;

  datalines4;
Not Null|work|sample|name
Not Null|work|sample|sex
In a List|work|sample|sex|'F','M'
Not In a List|work|sample|name|'alfred'
Not In a List|||demo|'alfred'
;;;;

Patrick_0-1646908485936.png

 

Thanks,

Patrick

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Patrick,

 

Insert the tilde modifier after snippet in the INPUT statement:

  snippet ~

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hi @Patrick,

 

Insert the tilde modifier after snippet in the INPUT statement:

  snippet ~

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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