Help using Base SAS procedures

Numeric values have been converted to character values at the places given

Reply
Super Contributor
Posts: 400

Numeric values have been converted to character values at the places given

When I run the statement below I get

Numeric values have been converted to character values at the places given by: (Line)Smiley SadColumn).

data step2(keep=AddType) ;
length AddType 8. ;
set step1 ;

AddType=input(MType, best.) ;
run ;

Within table step1 MType is defined as number 8. I can't see where there would be a conversion taking place. That entire column in this specific table is all 1's so I know it's numeric I don't see why SAS wants to convert it.

Any help would be appreciated.

Thank You
Super Contributor
Super Contributor
Posts: 3,174

Re: Numeric values have been converted to character values at the places given

Posted in reply to jerry898969
It would be best to share your expanded SAS log output (from the DATA step in question, with SAS line numbers for reference) as well as reviewing a CONTENTS listing to confirm what variable(s) are CHARACTER and/or NUMERIC.



Scott Barry
SBBWorks, Inc.
Super Contributor
Posts: 400

Re: Numeric values have been converted to character values at the places given

Scott,
Here is the info you mentioned

986 data step2(keep=AddType) ;
987 length AddType 8. ;
988 set step1 ;
989
990 AddType=input(MType, best.) ;
991 run ;

NOTE: Numeric values have been converted to character values at the places given by: (Line)Smiley SadColumn).
990:15
NOTE: There were 31 observations read from the data set WORK.STEP1.
NOTE: The data set WORK.STEP2 has 31 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

Data Set Page Size 4096
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 501
Obs in First Data Page 31
Number of Data Set Repairs 0
File Name C:\SAS\step1.sas7bdat
Release Created 9.0101M3
Host Created XP_PRO


Alphabetic List of Variables and Attributes

# Variable Type Len

1 MType Num 8
Super Contributor
Super Contributor
Posts: 3,174

Re: Numeric values have been converted to character values at the places given

Posted in reply to jerry898969
You are asking SAS to convert the variable MType using a numeric INFORMAT, so to do so it must first convert the input variable to a suitable type which is explained in the diagnostic message. You need not do any conversion, just an assignment statement since both variables are numeric.

Scott Barry
SBBWorks, Inc.

SAS conference (SUGI/SGF) paper on this topic - found on SAS support website http://support.sas.com/
Debugging 101
Peter Knapp, U.S. Department of Commerce
http://www2.sas.com/proceedings/sugi29/257-29.pdf
PROC Star
Posts: 1,759

Re: Numeric values have been converted to character values at the places given

Posted in reply to jerry898969
Input() takes a string as its first parameter.
Super Contributor
Posts: 400

Re: Numeric values have been converted to character values at the places given

Thanks guys,
I'm still learning and this code was done by someone else so I was trying to clean it up and figure out how to make it better.

Thank you both for the help

Jerry
Ask a Question
Discussion stats
  • 5 replies
  • 455 views
  • 0 likes
  • 3 in conversation