COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### help in CALL NLPQN inside PROC IML

• Email
• Follow

```proc iml;
start fun(K);
f =  sumf;
sumf=0;
do i = 1 to 3;
sumf = sumf + (estvar*lambda[i])+ (g[i]* k)**2  /(lambda[i]+  k)**2;
end;
return (f);
finish 	fun;
start con(k);
c=j(4,1,0);
sumc1=0;
do i = 1 to 3;
sumc1 = sumc1 + (col1[i]**2 *lambda[i]/(lambda[i]+k)**2);
end;
c[1]= 10-sumc1;
sumc2=0;
do i= 1 to 3;
sumc2 = sumc2 + (col2[i]**2 *lambda[i]/(lambda[i]+k)**2);
end;
c[2]= 10-sumc2;
sumc3=0;
do i= 1 to 3;
sumc3 = sumc3 + (col3[i]**2 *lambda[i]/(lambda[i]+k)**2);
end;
c[3]= 10-sumc3;
c[4]=(max(lambda)/min(lambda))-(max(lambda)+k)/(min(lambda)+k);
return (c);
finish con;
k=j(1,1,0);
optn=j(0,11,.); optn[1]=0; optn[2]=4; optn[4]=1; optn[6]=2;
optn[11]=0; optn[10]=4;
call nlpqn (rc, kres,  "fun", k, optn) nlc="con";
print k;

where g,l,estvar,col1,col2,col3 are vectors
and k is a decision variable
```
 0
Reply ayaafarag (10) 3/24/2011 7:56:56 PM

See related articles to this posting

0 Replies
343 Views

Similar Articles

12/18/2013 4:30:52 AM
page loaded in 27937 ms. (0)

Similar Artilces:

Multiple Titles inside Proc IML
How can one write multiple titles inside proc IML? Thanks Manoj, I'm not very familiar with IML, but I think that it uses the same conventions for titles as does mostly everything else in SAS. See, e.g.: http://javeeh.net/sasintro/intro92.html Art ----------- On Dec 24, 12:02=A0am, ManojK <khandelwalmano...@gmail.com> wrote: > How can one write multiple titles inside proc IML? > Thanks ...

PHP calling TCL proc causes thousands of server errors
if (!function_exists('proper_case')) { /** * Ths function will convert a string into a proper case format using the customized TCL proc "PROPER_CASE" from the included TCL string tools libraries * * @access public * @param mixed \$text * @param mixed \$tclLibPath Path to TCL Library files * @param DBActionPerformer \$dbAP You must generate a descendant of MethodGeneratorForActionPerformer to retrieve customized command-line formatting to call TCL shell * @return mixed \$text properly formatted in Proper Case Form * @see DBActionPerformer * @uses tcl_st...

Calling a Proc From a Proc
I'm having problems calling my second proc (MyProcedure2) from within an existing proc. MyProcedure2 does not seeem to fire this way. My code is below. Help appreciated. Thanks, Trevor ALTER procedure dbo.MyProcedure1 (@newsletterid int) AS SET NOCOUNT ON -- Return Subscribers declare @howmany int set @howmany=isnull((select count(subscriberid) from mySubscribers where newsletterid=@newsletterid),0) update Mynewsletters set status=3,howmany=@howmany where newsletterid=@newsletterid select @howmany exec MyProcedure2 *** Sent via Developersdex http://www.developersdex.com *** hi the ...

Re: PROC inside PROC
>>>> "Arvind Chande" <arvind.chande@GMAIL.COM> 11/08/2004 9:38 PM >>> >My requirement is to use some of the standard PROCs like SORT, FREQ >etc. inside PROC GA for user defined objective fuction. >Have anyone tried out such things? Hi, Arvind, You cannot call procs in another proc. But proc ga can call functions and subroutines you write in proc fcmp or proc ga itself. I have posted a rather *slow* code using proc ga http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0409A&L=sas-l&P=R18533&D=1&O=D It turned out that Richard -- who ask...

Re: PROC inside PROC #6
To reply to all those who said it actually isn't running a proc inside a proc run the following code, look at the log: %symdel count; data test1; x = 1; run; data test2; x = 1; run; data test3; x = 1; run; data foo; retain data 0; do pt=10 to 1 by -1; drug="ABC"; do visit=1 to 3; data+1; output; end; end; do pt=20 to 11 by -1; drug="DEF"; do visit=3 to 1 by -1; data+1; output; end; end; run; %let count = 0; proc report data=foo nowd headline; column drug pt temp visit dat...

Re: PROC inside PROC #3
How did you run a PROC DATASETS inside a PROC REPORT? It might be possible in version 9 with pipelined data streams, but that's not in version 8. -- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA >>> "Dunn, Toby" <Toby.Dunn@TEA.STATE.TX.US> 11/08/2004 11:15 AM >>> The short answer is sometimes. I have run a proc datasets inside a a proc report. So yes sometimes you can and other times you can't. The reason for the proc report is due to how it creates the report. You...

Re: PROC inside PROC #5
That's interesting. It hadn't occured to me to use CALL EXECUTE inside PROC REPORT. However, that code doesn't actually run proc datasets inside (simultaneously with) PROC REPORT. It schedules PROC DATASETS for execution after PROC REPORT has completed. -- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA >>> "Dunn, Toby" <Toby.Dunn@TEA.STATE.TX.US> 11/08/2004 12:14 PM >>> I am running it on windows XP v9.1.2 Here is the code that I used: %symdel count; data foo; ...

Re: PROC inside PROC #13
Actually, in the case of SAS, it is "pieces of the same PROC running at the same time on multiple processors". Jan Squillace Comprehensive NeuroScience One Copley Parkway, Suite 534 Morrisville, NC 27560 email: jsquillace@cnsmail.com Phone: 919-674-2526 Fax: 919-674-2538 Date: Tue, 9 Nov 2004 08:53:03 -0500 From: "Fehd, Ronald J." <RJF2@CDC.GOV> Subject: Re: PROC inside PROC > From: Ed Heaton > Good news! > > If you are running SAS 9.1 on a machine with multiple processors, you > can start a SORT procedure and pipe the output directly into an...

Re: PROC inside PROC #11
Good news! If you are running SAS 9.1 on a machine with multiple processors, you can start a SORT procedure and pipe the output directly into another procedure running on another CPU without having to wait for the SORT procedure to finish. Unfortunately, my wife hasn't authorized the purchase of a multi-processor machine; so I haven't worked through any of the details. Ed Edward Heaton, SAS Senior Systems Analyst, Westat (An Employee-Owned Research Corporation), 1600 Research Boulevard, RW-3541, Rockville, MD 20850-3195 Voice: (301) 610-4818 Fax: (301) 610-5128 mai...