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

I have to import a few columns from a data set from 1 to 4. in future I might have from 1 to n. Currently, the issue I'm facing is if i give as  (diag_1 $ diag_2 $ diag_3 $ diag_4 $ ) its able to pick the string value , but if i give as (diag_1 $ - diag_4 $;) only in 1 and 4th we are getting the string , , 

Please can anyone help me on this, since I'm new to SAS.

data file1;
infile '/folders/input/step1/file5.csv' dlm=',' firstobs=2;
input recipno diag_1 $ - diag_4 $;
run;  

 

1 ACCEPTED SOLUTION
4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

A text file is not a data set.

A data set is a SAS table. At least when talking to SAS users like you are here. Use the proper terminology to get the best help. 🙂

You want to import from a text file into a SAS data set.

Shuail_Ibrahim
Calcite | Level 5
@ChrisNZ, I'm extremely sorry for that, since I'm new to SAS that's why these sets of questions get arrived. if I get experienced I can match your terminology ... which will make you easier to answer.
ChrisNZ
Tourmaline | Level 20

No worries. That's exactly why I highlight the terminology issue 🙂

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 580 views
  • 0 likes
  • 3 in conversation