DATA Step, Macro, Functions and more

remove if dilimiter as an enter character

Reply
Frequent Contributor
Posts: 76

remove if dilimiter as an enter character

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

Regards,

Ashwini.

Contributor DCL
Contributor
Posts: 35

Re: remove if dilimiter as an enter character

Is this your requirement?

data test;

input field1 $ field2 $ field3 $;

infile datalines flowover;

datalines;

f11

f12

f13

f21

f22

f23

;

run;

SAS Employee
Posts: 104

remove if dilimiter as an enter character

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.

PROC Star
Posts: 7,363

remove if dilimiter as an enter character

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?

Ask a Question
Discussion stats
  • 3 replies
  • 283 views
  • 0 likes
  • 4 in conversation