- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SAS treats Blank space as missing values . In order to distinguish between blank space character and null value while reading from job how to manage it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You said it yourself, SAS treats blank as missing/null, so basically, you can't (since there is no difference).
If your source data resides in a DBMS that distinguish between NULL and blank, you coud do a SQL pass-thru query where you test this in the source.
What's your issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
no my source is a fixed width file
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
So if you have a fixed width file how would it be possible to have an empty field? To make it fixed width there has to be some character in those columns of the file.
If you use $CHAR informat instead of the default $ informat for character variables then periods in the source file will not be translated to blanks.
data want;
input id 3. sex $char1. age 3. ;
cards;
001M010
002F012
003.011
004 013
;;;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
File format is important here and how the data set is read. When using list input blanks are delimiters and options control what may or may not be missing.
Is your data delimited or fixed column?
How are you reading it?
It may be helpful to provide some example rows of data with the issue you are having.
Some common options that address bits of this kind of issue are DLM (or Delimiter) , DSD, RECFM plus options on Input statements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
the source is a fixed width file.