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 ~

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 678 views
  • 1 like
  • 2 in conversation