When using optmodel and using read data can i do calculation. like i want to take 10% of the value "FEU" and store in this number GIC_Min. Not sure if i can do that. I did that and got error.
num GIC_Min;
READ DATA STDOPT.PN3158_specifics INTO GIC_Min=0.1*[FEU];
No, you cannot do that. You need an explicit assignment statement after the READ DATA statement, as demonstrated in these two documentation examples:
With CREATE DATA, you can perform calculations if you use parentheses around the expression, as shown in the documentation here.
No, you cannot do that. You need an explicit assignment statement after the READ DATA statement, as demonstrated in these two documentation examples:
With CREATE DATA, you can perform calculations if you use parentheses around the expression, as shown in the documentation here.
Thanks Rob I will go through those two examples.
I have 4 or 5 questions those are very specific to a constraint. Can i post those as a separate thread (one for each)?
Yes, please use separate threads for different questions.
THe assignment statement in your example did the trick. Awesome Rob! Thank you very much
READ DATA STDOPT.PN3158_ALT6_SPECIFICS INTO LAX_Min=FEU
In this read data statement in proc optmodel, I want to read only when the column name in my table "Dest" = "LAX".
How do I specify the condition?
You can use DATA step options in the READ DATA statement, as documented here.
For your example, it would like this:
READ DATA STDOPT.PN3158_ALT6_SPECIFICS(where=(Dest = "LAX")) INTO LAX_Min=FEU;
Awesome. Thanks a lot Rob
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.