optimization convertMps

Financial Portfolio - Minimalist & Format Resilience

Scénario de test & Cas d'usage

Business Context

A financial analyst is testing a prototype portfolio model with very few constraints but irregular formatting (extra spaces) in a 'FREE' format file. This 'Edge Case' tests if the parser is robust enough to handle irregular whitespace and minimal problem definitions often found in early-stage modeling.
Data Preparation

Creation of a small, irregularly spaced 'FREE' format MPS table.

Copied!
1DATA casuser.mps_irregular; INFILE DATALINES; INPUT id line $80.; DATALINES;
21 NAME PORTFOLIO
32 ROWS
43 N RETURN
54 L RISK
65 COLUMNS
76 ASSET_A RETURN 0.05
87 ASSET_A RISK 0.02
98 ASSET_B RETURN 0.08
109 ASSET_B RISK 0.12
1110 RHS
1211 LIMIT RISK 0.05
1312 ENDATA
14;
15RUN;

Étapes de réalisation

1
Execution on the irregular data without specifying maxLength (testing default behavior).
Copied!
1 
2PROC CAS;
3optimization.convertMps /
4DATA={name='mps_irregular'} FORMAT='FREE' casOut={name='mps_clean_portfolio', replace=true};
5 
6RUN;
7 
8QUIT;
9 
2
Check if the action failed or succeeded despite irregular spacing.
Copied!
1 
2PROC CAS;
3SIMPLE.summary / TABLE='mps_clean_portfolio';
4 
5RUN;
6 
7QUIT;
8 

Expected Result


The action should succeed because 'FREE' format is designed to handle variable whitespace. The output table 'mps_clean_portfolio' should be correctly structured, normalizing the input irregularities.