data credit;
input _id_ $ w1 w2 w3 e
_type_ $ _rhs_;
datalines;
object 0 0 0 1 min .
const1 24 2 0 -1 LE 100
const2 35 6 1 -1 LE 100
const3 40 4 1 -1 LE 100
const4 30 10 0 1 GE 100
const5 28 1 0 -1 LE 100
const6 50 5 1 -1 LE 100
const7 45 15 1 1 GE 100
const8 60 10 0 1 GE 100
const9 20 1 0 -1 LE 100
const10 25 5 1 1 GE 100
;
proc lp data=credit;
run;
57
58 data credit;
59 input _id_ $ w1 w2 w3 e
60 _type_ $ _rhs_;
61 datalines;
NOTE: Invalid data for w1 in line 63 8-16.
NOTE: Invalid data for w2 in line 63 18-19.
NOTE: Invalid data for e in line 64 1-6.
NOTE: Invalid data for _rhs_ in line 64 18-19.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
64 CHAR const2 35.6.1.-1 LE 100
ZONE 66677323303030232442333222222222222222222222222222222222222222222222222222222222
NUMR 3FE34203596919D10C50100000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
_id_=const1 w1=. w2=. w3=100 e=. _type_=3561- _rhs_=. _ERROR_=1 _N_=2
NOTE: Invalid data for w1 in line 65 8-16.
NOTE: Invalid data for w2 in line 65 18-19.
NOTE: Invalid data for e in line 66 1-6.
NOTE: Invalid data for _rhs_ in line 66 18-19.
66 CHAR const4 30.10.0.1 GE 100
ZONE 66677323303303032442333222222222222222222222222222222222222222222222222222222222
NUMR 3FE34403091090910750100000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
_id_=const3 w1=. w2=. w3=100 e=. _type_=30100 _rhs_=. _ERROR_=1 _N_=3
NOTE: Invalid data for w1 in line 67 8-16.
NOTE: Invalid data for w2 in line 67 18-19.
NOTE: Invalid data for e in line 68 1-6.
NOTE: Invalid data for _rhs_ in line 68 18-19.
68 CHAR const6 50.5.1.-1 LE 100
ZONE 66677323303030232442333222222222222222222222222222222222222222222222222222222222
NUMR 3FE34605095919D10C50100000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
_id_=const5 w1=. w2=. w3=100 e=. _type_=5051- _rhs_=. _ERROR_=1 _N_=4
NOTE: Invalid data for w1 in line 69 8-16.
NOTE: Invalid data for w2 in line 69 18-19.
NOTE: Invalid data for e in line 70 1-6.
NOTE: Invalid data for _rhs_ in line 70 18-19.
70 CHAR const8 60.10.0.1 GE 100
ZONE 66677323303303032442333222222222222222222222222222222222222222222222222222222222
NUMR 3FE34806091090910750100000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
_id_=const7 w1=. w2=. w3=100 e=. _type_=60100 _rhs_=. _ERROR_=1 _N_=5
NOTE: Invalid data for w1 in line 71 8-16.
NOTE: Invalid data for w2 in line 71 18-19.
NOTE: Invalid data for e in line 72 1-7.
NOTE: Invalid data for _rhs_ in line 72 18-19.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
72 CHAR const10 25.5.1.1 GE 100
ZONE 66677332330303032442333222222222222222222222222222222222222222222222222222222222
NUMR 3FE34100259591910750100000000000000000000000000000000000000000000000000000000000
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
_id_=const9 w1=. w2=. w3=100 e=. _type_=25511 _rhs_=. _ERROR_=1 _N_=6
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.CREDIT has 6 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 497.50k
OS Memory 28060.00k
Timestamp 06/23/2015 03:12:05 AM
Step Count 423 Switch Count 178
Page Faults 0
Page Reclaims 96
Page Swaps 0
Voluntary Context Switches 822
Involuntary Context Switches 492
Block Input Operations 0
Block Output Operations 272
73 ;
75 proc lp data=credit;
76 run;
ERROR: '3561-' is not a valid keyword for the 'TYPE' variable in observation 2. Valid keywords are: 'MAX', 'MIN' 'LE', 'EQ',
'GE', 'UNRSTRCT', 'LOWERBD', 'UPPERBD', 'BASIC', 'PRICESEN', 'FREE', 'INTEGER', 'FIXED', 'BINARY', 'SOSEQ' and 'SOSLE'.
ERROR: '30100' is not a valid keyword for the 'TYPE' variable in observation 3. Valid keywords are: 'MAX', 'MIN' 'LE', 'EQ',
'GE', 'UNRSTRCT', 'LOWERBD', 'UPPERBD', 'BASIC', 'PRICESEN', 'FREE', 'INTEGER', 'FIXED', 'BINARY', 'SOSEQ' and 'SOSLE'.
ERROR: '5051-' is not a valid keyword for the 'TYPE' variable in observation 4. Valid keywords are: 'MAX', 'MIN' 'LE', 'EQ',
'GE', 'UNRSTRCT', 'LOWERBD', 'UPPERBD', 'BASIC', 'PRICESEN', 'FREE', 'INTEGER', 'FIXED', 'BINARY', 'SOSEQ' and 'SOSLE'.
ERROR: '60100' is not a valid keyword for the 'TYPE' variable in observation 5. Valid keywords are: 'MAX', 'MIN' 'LE', 'EQ',
'GE', 'UNRSTRCT', 'LOWERBD', 'UPPERBD', 'BASIC', 'PRICESEN', 'FREE', 'INTEGER', 'FIXED', 'BINARY', 'SOSEQ' and 'SOSLE'.
ERROR: '25511' is not a valid keyword for the 'TYPE' variable in observation 6. Valid keywords are: 'MAX', 'MIN' 'LE', 'EQ',
'GE', 'UNRSTRCT', 'LOWERBD', 'UPPERBD', 'BASIC', 'PRICESEN', 'FREE', 'INTEGER', 'FIXED', 'BINARY', 'SOSEQ' and 'SOSLE'.
ERROR: A semantic error has been detected. Perhaps you have a model specified in the sparse format and have not used the correct
option. The dense model format is assumed by default. The SPARSEDATA option is needed for models using the sparse format.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 6 observations read from the data set WORK.CREDIT.
NOTE: PROCEDURE LP used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1437.43k
OS Memory 29100.00k
Timestamp 06/23/2015 03:12:05 AM
Step Count 424 Switch Count 50
Page Faults 0
Page Reclaims 176
Page Swaps 0
Voluntary Context Switches 182
Involuntary Context Switches 109
Block Input Operations 0
Block Output Operations 1056
77
78
79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
91
Its a good idea to actually ask your question(s).
You have data problems as the invalid data notes:
35.6.1.-1
on line 64 of your data. There are multiple decimal points for what is being read as a number. Also .-1 is invalid and needs a space before the '-' You may have meant
35 6.1 -1
Similar for other lines.
Because the program was trying to 35.6.1.-1 as ONE value as there were no spaces, then the other columns were read out of order causing some of your data to be in the wrong variable. And since the _type_ variable for Proc LP is restricted to certain keywords the values you ended up with from reading the data such as 3561- caused the errors.
Fix your input data by insuring there are spaces between all of your values.
Also on this forum please ask a question in a single topic area. If it is in the wrong place then the moderators may move it or a suggestion as to a specific forum may be made.
Thanks
Questions about linear programming are more suitable for the Mathematical Optimization, Discrete-Event Simulation, and OR community. Also, note that PROC LP is a legacy procedure no longer under active development. PROC OPTMODEL is recommended instead. See this SAS Global Forum paper:
http://support.sas.com/resources/papers/proceedings11/200-2011.pdf
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.