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

Hi,

I am not able to import the attached file using SAS EG. This is a comma seperated file and I gave this option while importing.

However, it is not delimiting properly.

Can some one please help me to get the code for importing this file.

Sample file attached with this.

Thanks,

+Sathyan

1 ACCEPTED SOLUTION

Accepted Solutions
Doc_Duke
Rhodochrosite | Level 12

get rid of the quotes.  SAS thinks you only have one variable.

View solution in original post

2 REPLIES 2
Doc_Duke
Rhodochrosite | Level 12

get rid of the quotes.  SAS thinks you only have one variable.

Geraldo
Fluorite | Level 6

This example for import without error.

data TEST_IMPORT;

infile '/sasworwk/SAS_workDADAEA/input.txt' dsd delimiter=',' firstobs=2;

/* change '"' for nothing */

input @;

_infile_ = prxchange('s/"//',-1,_infile);

length

       'Carrier ID'n 8.

       'Phr NPI'n 8.

       'Phr Network ID'n 8.

       'Phr Zip'n 8.

       'Drug Maintenance Code'n $1.

       'PHA Pharmacy State'n $2.

       'Gen Ind-Override'n $1.

       'GPI Number'n 8.

       'Customer Location'n $2.

       'U & C Flag'n 8.

       'Days Supply'n 8.

       'Zero Balance Claims Flag'n 8.

       'Extended AWP Cost'n 8.

       'Claim Counter'n 8.

       'Clt Ingred Cost Paid'n 8.

       'Clt Dispensing Fee'n 8.

       'Clt Due Amt'n 8.

       'Phr Ingred Cost Paid'n 8.

       'Phr Dispensing Fee'n 8.

       'Phr Due Amt'n 8.;

input

       'Carrier ID'n

       'Phr NPI'n

       'Phr Network ID'n

       'Phr Zip'n

       'Drug Maintenance Code'n $

       'PHA Pharmacy State'n $

       'Gen Ind-Override'n $

       'GPI Number'n

       'Customer Location'n $

       'U & C Flag'n

       'Days Supply'n

       'Zero Balance Claims Flag'n

       'Extended AWP Cost'n

       'Claim Counter'n

       'Clt Ingred Cost Paid'n

       'Clt Dispensing Fee'n

       'Clt Due Amt'n

       'Phr Ingred Cost Paid'n

       'Phr Dispensing Fee'n

       'Phr Due Amt'n;

run;

It´s

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1237 views
  • 0 likes
  • 3 in conversation