BookmarkSubscribeRSS Feed
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You'll notice in my post/reply, there is a SASLOG that demonstrates the conversion technique, which would mimic the IMPORT, I believe. The data-string goes from character, to numeric, and back to character, remaining intact.

Scott Barry
SBBWorks, Inc.
Cynthia_sas
Diamond | Level 26
Hi:
You are showing the log of the original program. I would be more interested in the log of the CHANGED program. For example, if I run THIS program
[pre]
data WORK.TEMP ;
infile datalines
delimiter = ',' DSD firstobs=2 ;
informat FILING_ID $14. ;
informat name $8.;
format filing_id $14.;
input filing_id $ name $;
put _all_;
return;
datalines;
filing_id name
12345678901234,alan
22223333444455,bob
;
run;

proc print data=work.temp;
run;
[/pre]

Which essentially reduces the program to only 2 variables, but uses the INPUT and INFORMAT you -said- you used -- then in the log, I see that the number is a character string. So there's still something happening when you run the CHANGED program that is not right.

My output in the LOG shows the FILING_ID as a character string with ALL digits and no E notation.
[pre]
66 data WORK.TEMP ;
67 infile datalines
68 delimiter = ',' DSD firstobs=2 ;
69 informat FILING_ID $14. ;
70 informat name $8.;
71 format filing_id $14.;
72 input filing_id $ name $;
73 put _all_;
74 return;
75 datalines;

FILING_ID=12345678901234 name=alan _ERROR_=0 _N_=1
FILING_ID=22223333444455 name=bob _ERROR_=0 _N_=2
NOTE: The data set WORK.TEMP has 2 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds


79 ;
80 run;

[/pre]

cynthia

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
  • 16 replies
  • 3645 views
  • 0 likes
  • 5 in conversation