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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1446 views
  • 0 likes
  • 4 in conversation