DATA Step, Macro, Functions and more

Have a SAS file with 2 numeric variables that can have missing values..how to chg to Char for output

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Have a SAS file with 2 numeric variables that can have missing values..how to chg to Char for output

We read multiple a SAS files with 2 numeric variables that can have missing values. We output selective fields to a CSV which is downloaded from the mainframe to a server. Server software has a problem with the Period(.) when the data is missing as it's expecting either a number or 2 consecutive delimiters(a comma in this case.) Varibles REALSIZE and VIRTSIZE are both numeric. Code is below and sample output below code.

 

DATA IPLOUT;
SET IPLDATA;
date2=put(ipldate,mmddyys10.);
time2=put(ipltime,time11.2);
downtm2=put(downtm,time11.2);
keyind=compress(system||ipldate||ipltime);
delim=",";
recout= system||delim||custid||delim||date2||delim||time2
||delim||downtm2||delim||realsize||delim||virtsize
||delim||product||delim||sysplex||delim||keyind
;
recout=compress(recout);
FILE IPLPOUT NOTITLES;
put recout;

 

AXX1,TE,11/06/2016,16:11:56.86,0:00:00.03,.,.,,,ADTE2076458316.86
AXX1,TE,11/06/2016,17:56:58.08,0:00:00.03,.,.,,,ADTE2076464618.08
AXX2,TP,11/06/2016,22:49:39.93,0:00:00.12,.,.,,,ADTP2076482179.93
AXX2,TP,11/20/2016,0:55:26.42,0:00:00.14,5242880,2097152,SP7.2.1,ZZPLEX1,ADTP207


Accepted Solutions
Solution
‎12-20-2016 06:21 AM
Super User
Posts: 11,343

Re: Have a SAS file with 2 numeric variables that can have missing values..how to chg to Char for ou

Try

Options missing=' ';  <= there is a space inbetween the single quotes

before the data step.

Then all those conversions of missing values will receive a blank instead of a .

 

You should reset back to Options missing='.'; afterward.

View solution in original post


All Replies
Solution
‎12-20-2016 06:21 AM
Super User
Posts: 11,343

Re: Have a SAS file with 2 numeric variables that can have missing values..how to chg to Char for ou

Try

Options missing=' ';  <= there is a space inbetween the single quotes

before the data step.

Then all those conversions of missing values will receive a blank instead of a .

 

You should reset back to Options missing='.'; afterward.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 119 views
  • 1 like
  • 2 in conversation