04-26-2017 12:15 PM
okay, so i imported a couple of tables and am building a table out of the data. the table is 5x5. so i have 4 columns that need to be summed and put into fields then i need to subtract those fields to fill in the third row. so after searching i found i could use macro variables to get the data inot variables and subtract them.. however, the column i am summing, even though i put the format importing as commaw.d, after summing is getting put into the table in **bleep** scientific notation which i cannot understand why since the columns are set up as decimal 20,2 which should be enough room for anything but it INSISTS!
so now when i subtract the variables, i get an error and cannot figure out how to get the values into numeric format so i can evaluate.
|Current Months File||56715853||.||.||.|
|Current Months S File||.||.||.||.|
04-26-2017 01:10 PM
thanks astounding. that worked perfectly. one further thing, why is the data being put into sci format and how can i put it into numeric format (integers, decimals)? everything works as is and i know i can pull using a format so it is not there but for my curiosity...
04-26-2017 01:19 PM
I'm not sure this is the "why" for this particular case, but there is a general principle. If you assign a format to a variable, SAS goes out of its way to respect the width of the format. With a comma w.d format, SAS will do whatever it takes to express the value with a width of "w" (including using scientific notation of necessary).
Need further help from the community? Please ask a new question.