DATA Step, Macro, Functions and more

Back on-line in text file

Reply
Super Contributor
Posts: 378

Back on-line in text file

[ Edited ]

Hello experts,

Please, I need a solution for the back on-line in text file used by sas under unix.

 

Exemple

 

toto.txt(incorrect)

ID   name         comments

1     Cook          treatement

ùR10 Beta45 

 

The correct file  will be

ID   name         comments

1     Cook          treatement R10 Beta45 

 

Please, any solution in unix or sas or both ?

 

 the unix command cat -v gives this

1     Cook          treatementM^ùR10 Beta45

and the unix command "dos2unix does" not work for me.

 

Thank you

 

 

 

 

 

 

SAS Moderator
Posts: 61

Re: Back on-line in text file [how to improve your question]

Hello @LineMoon,


Your question requires more details before experts can help. Can you revise your question to include more information? 

 

Review this checklist:

  • Specify a meaningful subject line for your topic.  Avoid generic subjects like "need help," "SAS query," or "urgent."
  • When appropriate, provide sample data in text or DATA step format.  See this article for one method you can use.
  • If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition. Use the Photos button to include the image in your message.
    use_buttons.png
  • It also helps to include an example (table or picture) of the result that you're trying to achieve.

To edit your original message, select the "blue gear" icon at the top of the message and select Edit Message.  From there you can adjust the title and add more details to the body of the message.  Or, simply reply to this message with any additional information you can supply.

 

edit_post.png

SAS experts are eager to help -- help them by providing as much detail as you can.

 

This prewritten response was triggered for you by fellow SAS Support Communities member @Reeza

.
Super User
Posts: 13,507

Re: Back on-line in text file

Is this related to reading in a text file? If so show the code you attempted and example lines from the text file. Post code and example data in code box opened using the {I} icon. In a text file use of the code box is critical to retain plain text formatting. Otherwise lines shown could be quite different than the source.

 

The original source of the data may also be an issue as we should know whether your system is Unix or the source file originated on a Unix platform. If your system is Unix and the file is from a Mac or Windows system you may need to tell your program which line terminator to use when reading the file as the different operating systems use different ways to indicate the end of a line. The SAS INFILE option TERMSTR often helps.

Super Contributor
Posts: 378

Re: Back on-line in text file

[ Edited ]

@ballardw: Thank you very much.

 Yes, it is  related to reading a text file.

As you know, it is indpendant of code, it is really a data problem

 

I must have this data input

ID   name         comments

1     Cook          treatement R10 Beta45

 

With this matter, I will have

ID   name         comments

1     Cook          treatement

ùR10 Beta45

 

I think some unix commands can resolve the problem( my sas is under unix)

 

 

 

Ask a Question
Discussion stats
  • 3 replies
  • 74 views
  • 1 like
  • 3 in conversation