Help using Base SAS procedures

How to read a single '.' (Period) into a CHAR column from a File

Reply
N/A
Posts: 0

How to read a single '.' (Period) into a CHAR column from a File

Hi,
Can someone suggest how can i read a single '.' (Period) for a CHAR column from a File. When I read a file and there is a single '.' for a column with data type CHAR SAS converts the '.' value to a SPACE. I don't want to read . as space. I want to know when there was a space in the input file and when i get . then i want to retain it as some valid data.

When the input file has two back to back periods ('..') then I am able to read them just fine. The above mentioned problem arises when I try to read a single period into a char data type column.
Respected Advisor
Posts: 3,799

Re: How to read a single '.' (Period) into a CHAR column from a File

Posted in reply to deleted_user
The $w. informat is almost identical to the $CHARw. informat. However, $CHARw. does not trim leading blanks nor does it convert a single period in an input field to a blank, while $w. does both.
N/A
Posts: 0

Re: How to read a single '.' (Period) into a CHAR column from a File

Posted in reply to data_null__
Hi data _null_ (dont know your name so will use your community name Smiley Happy)

It works fine now. Thanks for your help.
Super User
Posts: 10,020

Re: How to read a single '.' (Period) into a CHAR column from a File

Posted in reply to deleted_user
Hi. I agree with data null;
Try to use $CHARw. informat.
Ask a Question
Discussion stats
  • 3 replies
  • 129 views
  • 0 likes
  • 3 in conversation