BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
hhchenfx
Barite | Level 11

Hi Everyone,

I have a column out which contain only value 1, 0,-1 based on IF THEN ELSE statement.

Then, I use proc expand to calculate moving sum and the output has -0 (in scientific format). 

I can kill the -0 with INT() but my program has hundred of column like that. Thus it is better that I solve the issue inside the proc expand.

Can you please help?

Thanks,

HHC

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Change the conversion method to something other than the default (SPLINE). Try METHOD=STEP, for example.

PG

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

First, you could change the format of all of these variables such that –0 will appear as zero. Although I am surprised that a sum of integers would give a –0, and I am thinking perhaps you haven't really described everything going on.

 

If that's not it, you could write an ARRAY to perform whatever task you want on all variables.

--
Paige Miller
PGStats
Opal | Level 21

Change the conversion method to something other than the default (SPLINE). Try METHOD=STEP, for example.

PG
hhchenfx
Barite | Level 11

Thanks a lot!

It works.

HHC

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
  • 3 replies
  • 786 views
  • 1 like
  • 3 in conversation