BookmarkSubscribeRSS Feed
Ashwini
Calcite | Level 5

when delimeter is , or *,&,^ we are use dlm in input . If enter charecter is a delimiter how we remove from the data.

Regards,

Ashwini.

3 REPLIES 3
DCL
Obsidian | Level 7 DCL
Obsidian | Level 7

Is this your requirement?

data test;

input field1 $ field2 $ field3 $;

infile datalines flowover;

datalines;

f11

f12

f13

f21

f22

f23

;

run;

SASJedi
SAS Super FREQ

You'll need to know the hex value of the ASCII code for the character you which are referring to as "ENTER" (or EBCDIC code, if you are running on a mainframe).  In my expereince, Windows systems use a combination of carriage return (CR-hex code '0D') and Line Feed (LF - hex code '0A') at the end of each line in a text file, most Unix or LINUX systems use just the LF ('0A') and mainframes use NEw Line (NEL - hex code '15').  When you are reading a text file in SAS on the same type operating system used to create the file, there is usually no need to think about these differences.  The default behavior in SAS is "FLOWOVER" which means that SAS just reads in another line if it encounters an end of line marker before it has enough data to satisfy the INPUT statement. 

Trouble can sometimes be encoutered when reading in data created on a different operating system.  In any case, to specify a non-printable character (such as an LF) as a delimiter, you can specify it using a hex literal.  For example:

   INFILE "C:\temp\my.txt" dlm='0A'x; 

I hope this helps.  If that's not what you are looking for, posting a snippet of your data and a copy of the code you are worknig on will help us help you better.

Check out my Jedi SAS Tricks for SAS Users
art297
Opal | Level 21

Conversely, if it is going to a new record for each variable, while not simply include '/' in your input statement and read each variable from the next line?

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