Portfolio Selection with Transactions (optqpe03)

/***************************************************************/
/*                                                             */
/*          S A S   S A M P L E   L I B R A R Y                */
/*                                                             */
/*    NAME: optqpe03                                           */
/*   TITLE: Portfolio Selection with Transactions (optqpe03)   */
/* PRODUCT: OR                                                 */
/*  SYSTEM: ALL                                                */
/*    KEYS: OR                                                 */
/*   PROCS: OPTQP                                              */
/*    DATA:                                                    */
/*                                                             */
/* SUPPORT:                             UPDATE:                */
/*     REF:                                                    */
/*    MISC: Example 3 from the OPTQP chapter of                */
/*          Mathematical Programming.                          */
/*                                                             */
/***************************************************************/


data potrdata;
   input field1 $ field2 $ field3 $ field4 field5 $ field6 @;
datalines;
NAME    .         POTRAN    .            .          .
ROWS    .         .         .            .          .
N       OBJ.FUNC  .         .            .          .
G       RETURN    .         .            .          .
E       BUDGET    .         .            .          .
E       BALANC1   .         .            .          .
E       BALANC2   .         .            .          .
E       BALANC3   .         .            .          .
COLUMNS .         .         .            .          .
.       X1        RETURN    1.109048     BUDGET     1.0
.       X1        BALANC1   1.0          .          .
.       X2        RETURN    1.169048     BUDGET     1.0
.       X2        BALANC2   1.0          .          .
.       X3        RETURN    1.074286     BUDGET     1.0
.       X3        BALANC3   1.0          .          .
.       B1        BUDGET    .01          BALANC1   -1.0
.       B2        BUDGET    .01          BALANC2   -1.0
.       B3        BUDGET    .01          BALANC3   -1.0
.       S1        BUDGET    .01          BALANC1    1.0
.       S2        BUDGET    .01          BALANC2    1.0
.       S3        BUDGET    .01          BALANC3    1.0
RHS     .         .         .            .          .
.       RHS       RETURN    1120         .          .
.       RHS       BUDGET    1000         .          .
.       RHS       BALANC1   200          .          .
.       RHS       BALANC2   300          .          .
.       RHS       BALANC3   500          .          .
RANGES  .         .         .            .          .
BOUNDS  .         .         .            .          .
QUADOBJ .         .         .            .          .
.       X1        X1        0.054978     .          .
.       X1        X2        -.01748      .          .
.       X1        X3        -.0003       .          .
.       X2        X2        0.218898     .          .
.       X2        X3        -.00024      .          .
.       X3        X3        0.001532     .          .
ENDATA  .         .         .            .          .
;



title1 'The OPTQP Procedure';
proc optqp data=potrdata
  primalout = potrpout
  printlevel = 0
  dualout   = potrdout;
run;


title2 'Primal Solution';
proc print data=potrpout label;
run;