BookmarkSubscribeRSS Feed
jbr
Calcite | Level 5 jbr
Calcite | Level 5
importing data with the following format:

test>lname>fname>l>someid>newid>testcode>3>>311>345>EN\
U>Sun Certified System Administrator for Sun Cluster 3.2>SE345>\
A>100>0>0>1>DTW>04/26/2007>10:28:27>02:11:27>ny130>1>191 fitzpa\
trick trail>address>st>14586>USA>1>5853346029>>NONE GIVE\
N>0>>>>>>>>2>emp_no=eds3009>se_email=carin.maxson@eds.com>0>75>>\
129/42/0/t>0>200>2>NDA>seNDA>n>p>0>0>>0/0/0/t>Sun Certified Sys\
tem Administrator for Sun Cluster 3.2>mainA>s>p>0>75>>129/42/0/\
t>0>176>NDA2002.1a>2>0>>2>s>A>0>9>>NDA2002.2a>2>0>>3>s>B>0>36>>\
.....more data

note how some data is moved to following line. the "/" is a line continuation character in the data. how to address that is my issue
5 REPLIES 5
ChrisNZ
Tourmaline | Level 20
Do you mean "\" is a line continuation character ?

The data is difficult to decipher.

What would the records look like if they were stored one per line?
ChrisNZ
Tourmaline | Level 20
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
I am not sure you need to be concerned about a line-continuation character, which I believe is a back-slash, not a forward-slash. And, from your data, the column-delimiter might be ">" - correct?

With this in mind, the SAS INPUT process can read from multiple lines based on INFILE statement parameters. However, you will need to address the back-slash character during INPUT -- it likely has no real purpose with SAS performing INPUT statement.

My recommendation is you start by coding up a DATA step to read your input file with an INPUT statement and the desired INFORMATs, depending on your data.


Scott Barry
SBBWorks, Inc.
jbr
Calcite | Level 5 jbr
Calcite | Level 5
yes the 'backslash' is the line continuation character and the delimiter is '>'
Peter_C
Rhodochrosite | Level 12
that is a very inconvenient structure for SAS input routines.
It looks like a stream. Line breaks occur within words.
Is there an expected order for this information ?
Is there some equivalent to a "row delimiter" ?

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