Solved

covert character 8 to integer 8

Posted on 2011-09-02
5
295 Views
Last Modified: 2013-11-16
Hi,
How can i convert char 8 to integer 8 .

Thanks,
0
Comment
Question by:sam2929
5 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
Here is an option if I am understanding documentation correctly: use INPUT to go from character to integer and PUT to go from integer to character.
0
 

Author Comment

by:sam2929
Comment Utility
i did
input(IND,integer8.) it don't like it
0
 
LVL 14

Accepted Solution

by:
Aloysius Low earned 500 total points
Comment Utility
input(IND, best.)
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
Did you look at the link I provided? I don't believe integer8. is a proper informat. I think it is just 8.
http://support.sas.com/publishing/pubcat/chaps/59498.pdf

try:
input(IND, 8.)

Open in new window

or
input(IND, comma8.)

Open in new window

(latter is used when you need to strip commas from a string like '1,000'.
0
 
LVL 7

Expert Comment

by:d507201
Comment Utility
This code works just fine.  MWVISA1 is correct... the proper informat is 8. not integer8.  If the length of your character variable is varying then use the BEST. informat instead of 8.  SAS will always store the numbers in 8 bytes but numbers bigger than I think 14 digits will be stored in scientific notation and so lose precision when retrieved.

data charData;
char='12345678';
run;

Data numData; set charData;
num=input(char,8.);
put _all_;
run;

proc contents data=numData;
run;
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now