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:

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3921 views
  • 0 likes
  • 3 in conversation