BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
georgel
Quartz | Level 8

Dear SAS users: 

I would like to have an output dataset using id AT ATvol

cofor {i in row} do;
        id = i;

        solve;
        
        /* Save each individual solution */
          ATsol[id] = AT.sol;
         AT_Volsol[id] = AT_vol.sol;
    if id=1 then do;  
	create data solutionAT from  AT.sol;
	create data solutionATVol from  AT_vol.sol;
    end;

    if id>1 then do;  
	create data solutionAT_temp from  AT.sol;
	create data solutionATVol_temp from  AT_vol.sol;
    end;

This is an extract from proc optmodel: I tried to have data step  and append functions but this does not work.

I would appreciate your help 

Many thanks 

 

Best regards, 

George

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ
   num ATsol {row};
   num AT_Volsol {row};
cofor {i in row} do; id = i; solve; /* Save each individual solution */ ATsol[id] = AT.sol; AT_Volsol[id] = AT_vol.sol; end;
create data solutionAT from [i] ATsol; create data solutionATVol from [i] AT_Volsol;

View solution in original post

2 REPLIES 2
RobPratt
SAS Super FREQ
   num ATsol {row};
   num AT_Volsol {row};
cofor {i in row} do; id = i; solve; /* Save each individual solution */ ATsol[id] = AT.sol; AT_Volsol[id] = AT_vol.sol; end;
create data solutionAT from [i] ATsol; create data solutionATVol from [i] AT_Volsol;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 2 replies
  • 1726 views
  • 1 like
  • 2 in conversation