- /* try this */
- data test;
- infile datalines dlm=',' dsd;
- input company $ Product $ price;
- datalines;
- "ABC","PROD_A",2031
- "ABD","PROD_B",2032
- "ABE","PROD_C",2033
- "ABF","PROD_D",2034
- "ABG","PROD_E",2035
- ; run;
复制代码/* you can also use compress function to remove the double quote */
data test3;
infile datalines dlm=',' dsd;
input company $ Product $ price;
company=compress(company, ' " ');
product = compress(product, '"');
datalines;
"""ABC""","""PROD_A""",2031
"""ABC""","""PROD_A""",2032
"""ABC""","""PROD_A""",2033
"""ABC""","""PROD_A""",2034
"""ABC""","""PROD_A""",2035
; run;
* note: there is a dollar sign after company and product in the input statement;