BookmarkSubscribeRSS Feed
jerry898969
Pyrite | Level 9
When I run the statement below I get

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

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
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
jerry898969
Pyrite | Level 9
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):(Column).
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
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
jerry898969
Pyrite | Level 9
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 12525 views
  • 0 likes
  • 3 in conversation