BookmarkSubscribeRSS Feed
lavernal
Calcite | Level 5

Hi all,

I am trying to use proc import to create a SAS database. In particular, one of my columns contain CUSIP data, in which some are 9 digits numbers while some contain a mix of numbers and characters. Thus, I want to make SAS read in that column as character rather than numeric variables, however, the first few rows of my data are all numeric rather than a mix of numeric and character, thus SAS reads in that column as numeric.

Is there a way to just change that column format into character while keeping the other columns as default? I have quite alot of columns so would hope not to have to redefine all columns.

Thank you for any help!

1 REPLY 1
Jagadishkatam
Amethyst | Level 16

Hi ,

Please include the below statement in the proc import code, this will convert the numeric data to character values. This will help you to change the variable into character where there is numeric as well as character data, other columns will be as they are.

MIXED=YES;

Thanks,

Jagadish

Thanks,
Jag

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
  • 1 reply
  • 901 views
  • 0 likes
  • 2 in conversation