Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

covert character 8 to integer 8

Posted on 2011-09-02
Medium Priority
342 Views
Hi,
How can i convert char 8 to integer 8 .

Thanks,
0
Question by:sam2929
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 60

Expert Comment

ID: 36475437
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

ID: 36476614
i did
input(IND,integer8.) it don't like it
0

LVL 14

Accepted Solution

Aloysius Low earned 2000 total points
ID: 36476631
input(IND, best.)
0

LVL 60

Expert Comment

ID: 36476633
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.)
``````
or
``````input(IND, comma8.)
``````
(latter is used when you need to strip commas from a string like '1,000'.
0

LVL 7

Expert Comment

ID: 36497866
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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month4 days, 20 hours left to enroll