Help using Base SAS procedures

Help SAS reading data from .txt file

Reply
Occasional Contributor
Posts: 5

Help SAS reading data from .txt file

I am a beginning SAS user and have taken over a job with a company.

Many lines of data that the SAS program uses come from a .txt file.

One of the columns "On-Hand" is set up in SAS as a numeric value, however somehow in the .txt file a negative amount is written as (# -) instead of (- #). SAS can not read this as a numeric number.

Is there an easy way to have the number truly be a negative number?

     At first I tried to just convert it to a character, but another program uses this information for a calculation and I now get errors with the calculation.

I really appreciate it if anyone can help.

Respected Advisor
Posts: 3,777

Re: Help SAS reading data from .txt file

TRAILSGNw. Informat


Reads a trailing plus :smileyplus: or minus :smileyminus: sign.

PROC Star
Posts: 7,363

Re: Help SAS reading data from .txt file

I just discovered the post where you mentioned that earlier this summer and was just about to edit my own post.  I'll just delete my previous post as the correct answer, as you mentioned, is definitely trailsgnW.

Occasional Contributor
Posts: 5

Help SAS reading data from .txt file

Thanks for the help!

Occasional Contributor
Posts: 5

Help SAS reading data from .txt file

Thanks for the help!

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