optimization convertMps

National Logistics Network - High Volume & Long Names

Scénario de test & Cas d'usage

Business Context

A logistics firm optimizes delivery routes across the country. The model is generated dynamically by a Python script and loaded into CAS as a 'FREE' format MPS file. Variable names represent specific routes (e.g., 'Route_Seattle_to_Miami_Truck55'), which exceed the default 8-character limit. The test validates the handling of longer names and the processing of a generated dataset.
Data Preparation

Generation of a larger dataset using a Data Step loop to simulate a problem with longer variable names.

Copied!
1 
2DATA casuser.mps_logistics_large;
3LENGTH line $80;
4id=1;
5line='NAME BIG_ROUTE_OPT';
6OUTPUT;
7id=2;
8line='ROWS';
9OUTPUT;
10id=3;
11line=' N COST_FN';
12OUTPUT;
13DO i=1 to 50;
14id+1;
15line=' L CAP_LIMIT_'||strip(put(i,z3.));
16OUTPUT;
17END;
18id+1;
19line='COLUMNS';
20OUTPUT;
21DO i=1 to 50;
22id+1;
23line=' TRUCK_ROUTE_SEGMENT_'||strip(put(i,z3.))||' COST_FN 1.5';
24OUTPUT;
25id+1;
26line=' TRUCK_ROUTE_SEGMENT_'||strip(put(i,z3.))||' CAP_LIMIT_'||strip(put(i,z3.))||' 1.0';
27OUTPUT;
28END;
29id+1;
30line='RHS';
31OUTPUT;
32DO i=1 to 50;
33id+1;
34line=' RHS1 CAP_LIMIT_'||strip(put(i,z3.))||' 500.0';
35OUTPUT;
36END;
37id+1;
38line='ENDATA';
39OUTPUT;
40 
41RUN;
42 

Étapes de réalisation

1
Execution of convertMps with 'maxLength' set to 32 to accommodate long variable names.
Copied!
1 
2PROC CAS;
3optimization.convertMps /
4DATA={name='mps_logistics_large'} FORMAT='FREE' maxLength=32 casOut={name='mps_ready_solve', replace=true};
5 
6RUN;
7 
8QUIT;
9 

Expected Result


The 'mps_ready_solve' table is created without errors. Variable names like 'TRUCK_ROUTE_SEGMENT_001' are preserved in their entirety (not truncated to 8 chars), thanks to the maxLength=32 parameter.