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

Hello,

          I am a newbie to SAS and I am trying to import a CSV file into SAS Dataset . The import was successful. However the format of 16 digit long numeric values are represented as exponential values in SAS observations(TranID, CreditCardNo) in a particular datset. So can you please let me know how to view TranId, CreditCardNo as a normal 16 digit number in SAS Tables.

Capture.JPG

Thanks,

Sankar.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Are you going to use those for computation such as total TranId or average TranID? If not import them as character. If you imported them using proc import it makes a guess as to the data type something should be and if all digits then assumes they are numeric. Which will have issues with many ID values. Besides the appearance which is just the display format associated but numeric precision means that 16 digit numeric are not likely to be accurately stored.

Proc import, guessing that is what you used, will generate SAS datastep code that can (and often should) be modified to control import and display format. It is likely that you would see lines like:

informat TranID best16. ; Change them to informat TranId $16. ;

View solution in original post

3 REPLIES 3
art297
Opal | Level 21

Import those two fields as character variables with a length of 16. If you used proc import, modify the code that it produced (which should be shown in your log).

ballardw
Super User

Are you going to use those for computation such as total TranId or average TranID? If not import them as character. If you imported them using proc import it makes a guess as to the data type something should be and if all digits then assumes they are numeric. Which will have issues with many ID values. Besides the appearance which is just the display format associated but numeric precision means that 16 digit numeric are not likely to be accurately stored.

Proc import, guessing that is what you used, will generate SAS datastep code that can (and often should) be modified to control import and display format. It is likely that you would see lines like:

informat TranID best16. ; Change them to informat TranId $16. ;

sankarasarma
Calcite | Level 5

Thanks for providing the solution ballardw. Its Working now :smileygrin:

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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