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

I have the following format table....

start label fmtname type

dev_cumul1 1.43167 devfactors I

dev_cumul2 0.9861 devfactors I

dev_cumul3 0.98054 devfactors I

dev_cumul4 0.99966 devfactors I

dev_cumul5 1.0261 devfactors I

dev_cumul6 1.03256 devfactors I

dev_cumul7 1.00784 devfactors I

dev_cumul8 1.00418 devfactors I

dev_cumul9 1.01717 devfactors I

dev_cumul10 1.02158 devfactors I

dev_cumul11 1.01234 devfactors I

dev_cumul12 1.01011 devfactors I

dev_cumul13 0.98893 devfactors I

dev_cumul14 0.96408 devfactors I

dev_cumul15 0.97264 devfactors I

dev_cumul16 0.96371 devfactors I

dev_cumul17 0.97068 devfactors I

dev_cumul18 0.983 devfactors I

dev_cumul19 1.00195 devfactors I

dev_cumul20 1.00208 devfactors I

I was testing whether I could read in the values from this table and I included one value not listed in the 'start' column of the format table (dev_cumul100). However, the dataset test1 reads in a value for this? The output is given below the code:

data test;
input flag1 $14.;
datalines;
dev_cumul1
dev_cumul4
dev_cumul8
dev_cumul16
dev_cumul100

run;

data test1;
set test;
dev_factor = input(flag1,devfactors.);
run;

flag1 dev_factor

dev_cumul1 1.431666437

dev_cumul4 0.99965594

dev_cumul8 1.004175057

dev_cumul16 0.96371087

dev_cumul100 1.02158079

I would have thought the value for dev_cumul100 would be . since it's not on the format table.

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

The problem is the default W(idth) of the user defined informat.  Notice that the value for dev_cuml100 is the same as dev_cuml10.  Add w value to devfactors that is ge to the length of longest flag1, 11 I think.

View solution in original post

1 REPLY 1
data_null__
Jade | Level 19

The problem is the default W(idth) of the user defined informat.  Notice that the value for dev_cuml100 is the same as dev_cuml10.  Add w value to devfactors that is ge to the length of longest flag1, 11 I think.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 695 views
  • 0 likes
  • 2 in conversation