is there way to find all the Numeric variable and if obs is empty or . (dot), i want to replace all with Null value in one go
Add this OPTIONS statement to the start of your program to write out blanks instead of dots in your flat file:
options missing = ' ';
@animesh123 wrote:
I am trying to write the output into Flat file but when transferring into flat file am getting .(dot) am trying to replace with null value
Show the code you used to write the file. Explain the layout you want in the file.
Note if you are writing a delimited file then the PUT statement should already be writing "null" (that is nothing at all) for missing values. If it is writing whatever character you set with the MISSING option instead then you probably forgot to include the DSD option in the FILE statement.
I have dataset where the column is integer
while writing this into flat file or in sasdataset i am getting .(dot) instead of populating null value,
same dataset when exporting into excel using sas eg in there its coming blank
is there way to fix this to populate only Null for integer value rather than .(dot) also the same in text file where am writing into flat/text file
I do not understand what you are saying. Actual data examples would help much more than photographs to explain what you are asking about.
In SAS a MISSING numeric value (which what I assume you mean by NULL) is represented in CODE by a period. SAS also allows 27 other (special) missing values that are represented in CODE as a period followed by a single letter or the underscore character.
SAS will treat character variables that only contain spaces a missing.
When writing a numeric value to a text file using the default numeric format a normal missing value is represented by the character set with the MISSING= option. The default character used by the missing option is a period. Special missing values will be printed as letter used to represent them in the code.
When reading either a numeric or a character variable from a text file into SAS variables using the normal numeric or character informat a single period will be converted to a MISSING value. To allow single letters to be read by the normal numeric informat as special missing values list those letters (or underscore) in the MISSING statement.
See the documentation:
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/p0ueqauvtyb2hqn1mj79t26azlxv.htm
Note also that when writing a text file use the DSD option on the FILE statement then missing values will take NO space in the text file. The delimiters will be placed right next to each other. To treat adjacent delimiters as indicating a missing value when reading a delimited text file make sure to include the DSD option on the INFILE statement.
Are you asking to see text that actually says NULL?
That would require custom formats to associate missing values, by default displayed with the dot, and might be a little bit tricky depending on individual variable attributes such as existing formats.
I combined your posts dealing with the same issue.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.