Scénario de test & Cas d'usage
Generation of a larger dataset using a Data Step loop to simulate a problem with longer variable names.
| 1 | |
| 2 | DATA casuser.mps_logistics_large; |
| 3 | LENGTH line $80; |
| 4 | id=1; |
| 5 | line='NAME BIG_ROUTE_OPT'; |
| 6 | OUTPUT; |
| 7 | id=2; |
| 8 | line='ROWS'; |
| 9 | OUTPUT; |
| 10 | id=3; |
| 11 | line=' N COST_FN'; |
| 12 | OUTPUT; |
| 13 | DO i=1 to 50; |
| 14 | id+1; |
| 15 | line=' L CAP_LIMIT_'||strip(put(i,z3.)); |
| 16 | OUTPUT; |
| 17 | END; |
| 18 | id+1; |
| 19 | line='COLUMNS'; |
| 20 | OUTPUT; |
| 21 | DO i=1 to 50; |
| 22 | id+1; |
| 23 | line=' TRUCK_ROUTE_SEGMENT_'||strip(put(i,z3.))||' COST_FN 1.5'; |
| 24 | OUTPUT; |
| 25 | id+1; |
| 26 | line=' TRUCK_ROUTE_SEGMENT_'||strip(put(i,z3.))||' CAP_LIMIT_'||strip(put(i,z3.))||' 1.0'; |
| 27 | OUTPUT; |
| 28 | END; |
| 29 | id+1; |
| 30 | line='RHS'; |
| 31 | OUTPUT; |
| 32 | DO i=1 to 50; |
| 33 | id+1; |
| 34 | line=' RHS1 CAP_LIMIT_'||strip(put(i,z3.))||' 500.0'; |
| 35 | OUTPUT; |
| 36 | END; |
| 37 | id+1; |
| 38 | line='ENDATA'; |
| 39 | OUTPUT; |
| 40 | |
| 41 | RUN; |
| 42 |
| 1 | |
| 2 | PROC CAS; |
| 3 | optimization.convertMps / |
| 4 | DATA={name='mps_logistics_large'} FORMAT='FREE' maxLength=32 casOut={name='mps_ready_solve', replace=true}; |
| 5 | |
| 6 | RUN; |
| 7 | |
| 8 | QUIT; |
| 9 |
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.