BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Q1983
Lapis Lazuli | Level 10

data have;

format mydate date9.;

input ln_no $ state $ mydate date9.;

datalines;

 

1123 AL 1jun2018

1123 AZ

;

run;

data have2;

set have;

format date_yr_mth yymmd7.;

 

date_yr_mth = mydate;

date_yr_mth1 = put(date_yr_mth,yymmd7.);

run;

PROC EXPORT Outfile= "\\MyDrive\have3.xlsb"

DATA= have2

DBMS= EXCELCS REPLACE;

SHEET='Details';

SERVER='server1';

Note the second value AZ has no date it is a blank.  When it exports it somehow gets a .  When it runs through our sharepoint server it is assigned a "0"  I tried something like this in the datastep if date_yr_mth = '0' or date_yr_mth = . then date_yr_mth = ' ';  Yet it still assigns a . or '0' when it runs.  Is there a way in the proc export itself to assign all null values as a true null.  I do not want it to display anything in the field.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

 

 

Its not the export, check your HAVE2 data set. It has the periods as well.

Also, you may have the following set, that you'll need to reset:

 

option missing='0';

 

View solution in original post

2 REPLIES 2
Reeza
Super User

 

 

Its not the export, check your HAVE2 data set. It has the periods as well.

Also, you may have the following set, that you'll need to reset:

 

option missing='0';

 

Kurt_Bremser
Super User

If you want control of your process and have things done your way,

TAKE CONTROL!

This specifically precludes the use of something as crappy as .xlsb for data transfer.

Do this:

data have;
format mydate date9.;
input ln_no $ state $ mydate date9.;
datalines;
1123 AL 1jun2018
1123 AZ
;
run;

options missing = '';

data _null_;
set have;
file '/$HOME/sascommunity/out.csv' dlm=',' dsd;
if _n_ = 1 then put 'ln_no,state,mydate';
put
  ln_no
  state
  mydate
;
run;

instead.

Since xlsb involves a Microsoft-supplied piece of software along the way, you'll never know what happens in there. Mostly something that will curl your toenails.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 4680 views
  • 1 like
  • 3 in conversation