BookmarkSubscribeRSS Feed
Ani_Abby
Obsidian | Level 7

Hi,

 

I have a problem when I import dataset from textfile where some of the data has double quote but when I import the double quote goes missing. Example below is sample of my textfile

 

 Cust_ID|Name|Customer_Status

1|ABC|Active

2|"Def"|Inactive

3|FGH IKL|Active

4|KL, MNO|Terminate

5|PQ-RS TU|Close

 

This is my coding

 

DATA WORK.CUSTOMER (COMPRESS=BINARY);
   %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
   infile '/s1/text/extracted/customer_list.txt'
   delimiter = '|'
   TRUNCOVER DSD lrecl=32767 firstobs=2 recfm=D;

LENGTH

  CUST_ID 8

  CUST_NAME $40.

  CUST_STATUS $20.

;

 

FORMAT

  CUST_ID BEST32.

 ;

 

INPUT

  CUST_ID

  CUST_NAME $

  CUST_STATUS $

;

 

RUN;

 

Once run, the output only display as below 

 

Cust_ID Cust_Name Cust_Status
1 ABC Active
2 Def Inactive
3 FGH IKL Active
4 KL, MNO Terminate
5 PQ-RS TU Close

 

The main problem is the double quote is missing once I run this code. Is there any setting when using infile command?

1 REPLY 1
PGStats
Opal | Level 21

option DSD removes the quotes. Try again without option DSD but keep option DLM=

PG

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
  • 1 reply
  • 1079 views
  • 0 likes
  • 2 in conversation