LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 1999, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 9 Sep 1999 16:55:57 -0400
Reply-To:   Bernard Tremblay <bernard@CAPITALE.QC.CA>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:   To: "Hamani, Elmaache" <elmaachh@ERE.UMONTREAL.CA>
From:   Bernard Tremblay <bernard@CAPITALE.QC.CA>
Organization:   Imaginasys enr.
Subject:   Re: Macro non resolved yet!
Comments:   To: SAS-L@LISTSERV.VT.EDU
Content-Type:   text/plain; charset=us-ascii

Hi,

This piece of code is an example of what not to do when you want others to understand your code !

I suggest you rewrite everithing from scrap and avoid using anything macro until you know what you're doing!

... sorry for the flame I couldn't resist!

Now I will try to help (so you pardon me!)

I guess that you expected output to be printed after the heading:

common variance, Unique variance, Les cinq coeff. intra-class .

The reason why you dont have anything printed is becaused you used a %put instead of a put ... NB: you can't print datastep variables with a %put in a macro loop... they are know known to the macro processor (called BEFORE the step execute...).

I suggest you use:

put +8 MAT(&d1,&i) f4.3 '('MAT(&d2,&i) f4.3')'@; put +8 MAT(&d1,&i+&Nb2) f4.3 '('MAT(&d2,&i+&Nb2) f4.3')' @; put +11 RHO(&i) '%'@;

instead of %put ...

If I'm wrong in my assumption, then you should do the following:

1- use options mprint, mlogic, symbolgen, source, sourc2; re-run and show us the detailed log; 2- check if dataset RIE_ACE have any observations; 3- add the /debug options on the datastep and monitor the content of all variables to see if everything behave OK. 4- come back on the list with more info!

Good luck, Bernard Tremblay

-- \\\|/// \\ - - // ( @ @ ) +-----oOOo-(_)-oOOo-------+--------------------------------------+ | Bernard Tremblay | | | La Capitale | Tel: (418) 646-2401 | | | Fax: (418) 646-5960 | | | Int: Bernard.Tremblay@capitale.qc.ca | +-------------------------+--------------------------------------+ | Imaginasys enr | Res: (418) 658-1411 | | | Int: bertrem@quebectel.com | +--------------Oooo-------+--------------------------------------+ oooO ( ) ( ) ) / \ ( (_/ \_)

Hamani, Elmaache wrote: > > Dear Friends > > My macro is NOT resolved yet! The log does not indicate any error! I > get the above output. > > /*========================================================================*/ > > DATA RIE_ACE; > > SET MAT1 ; > > %LET INDI=%EVAL(&Nb/1); > > %LET Nb2=%EVAL(&Nb/2); > > %let d2=%EVAL(&d1+&d1); > > ARRAY MAT(&d2,&INDI) EST&d1-EST&INDI SE&d1-SE&INDI; > > ARRAY Rho(&Nb2) Rho&d1-Rho&Nb2; > > %DO I=&d1 %TO &Nb2; > > RHO(&i)=MAT(&d1,&i)/(MAT(&d1,&i)+MAT(&d1,&i+&Nb2)); > > %*; > > MAT(&d1,&i)=round(MAT(&d1,&i),0.001); > > MAT(&d2,&i)=round(MAT(&d2,&i),0.001); > > RHO(&i)=round(RHO(&i),0.0001)*100; > > %end; > > run; > > data _null_; > > set RIE_ACE; > > file print notitles; > > if _n_=1 then; > > * put "lA CHOSE EST =&Nb, d1=&d1 et d2=&d2" //; > > put +5 'Type1=mz-gar' +5 'Type2=mz-fille'+5 'Type3=dz-gar' > > +5'Type4=dz-fille' +5 'Type5=dz-opposi'//; > > %DO I=&d1 %TO &Nb2; > > put +12 "Type &i"@; > > %end; > > put @5 > '---------------------------------------------------------------------------------------'/; > > put //; > > put @5 'common variance'/; > > put @5 > '---------------------------------------------------------------------------------------'/; > > %DO I=&d1 %TO &Nb2; > > %put +8 MAT(&d1,&i)f4.3 '('MAT(&d2,&i)f4.3')'@; > > %end; > > put ; > > put @5 > '---------------------------------------------------------------------------------------'/; > > put @5 'Unique variance'/; > > %DO I=&d1 %TO &Nb2; > > %put +8 MAT(&d1,&i+&Nb2)f4.3 '('MAT(&d2,&i+&Nb2)f4.3')' @; > > %end; > > put; > > put @5 > '---------------------------------------------------------------------------------------'/; > > put @5 'Les cinq coeff. intra-class'/; > > %DO I=&d1 %TO &Nb2; > > %put +11 RHO(&i)'%'@; > > %end; > > RUN; > > %MEND MACR_SAT; > > /*========================================================================*/ > > Log SAS: > > SYMBOLGEN: Macro variable NB2 resolves to 5 > > +8 MAT(1,3+5)f4.3 '('MAT(2,3+5)f4.3')' @ > > SYMBOLGEN: Macro variable D1 resolves to 1 > > SYMBOLGEN: Macro variable I resolves to 4 > > SYMBOLGEN: Macro variable NB2 resolves to 5 > > SYMBOLGEN: Macro variable D2 resolves to 2 > > SYMBOLGEN: Macro variable I resolves to 4 > > SYMBOLGEN: Macro variable NB2 resolves to 5 > > +8 MAT(1,4+5)f4.3 '('MAT(2,4+5)f4.3')' @ > > SYMBOLGEN: Macro variable D1 resolves to 1 > > SYMBOLGEN: Macro variable I resolves to 5 > > SYMBOLGEN: Macro variable NB2 resolves to 5 > > SYMBOLGEN: Macro variable D2 resolves to 2 > > SYMBOLGEN: Macro variable I resolves to 5 > > SYMBOLGEN: Macro variable NB2 resolves to 5 > > +8 MAT(1,5+5)f4.3 '('MAT(2,5+5)f4.3')' @ > > MPRINT(MACR_SAT): PUT; > > MPRINT(MACR_SAT): PUT @5 > > '---------------------------------------------------------------------------------------'/; > > MPRINT(MACR_SAT): PUT @5 'Les cinq coeff. intra-class'/; > > SYMBOLGEN: Macro variable D1 resolves to 1 > > SYMBOLGEN: Macro variable NB2 resolves to 5 > > SYMBOLGEN: Macro variable I resolves to 1 > > +11 RHO(1)'%'@ > > SYMBOLGEN: Macro variable I resolves to 2 > > +11 RHO(2)'%'@ > > SYMBOLGEN: Macro variable I resolves to 3 > > +11 RHO(3)'%'@ > > SYMBOLGEN: Macro variable I resolves to 4 > > +11 RHO(4)'%'@ > > SYMBOLGEN: Macro variable I resolves to 5 > > +11 RHO(5)'%'@ > > MPRINT(MACR_SAT): RUN; > > NOTE: 22 lines were written to file PRINT. > > NOTE: The DATA statement used 0.31 seconds. > > /*========================================================================*/ > > The output: > > Type1=mz-gar Type2=mz-fille Type3=dz-gar Type4=dz-fille > Type5=dz-opposi > > > > --------------------------------------------------------------------------------------- > > > > > > > > common variance > > --------------------------------------------------------------------------------------- > > > > --------------------------------------------------------------------------------------- > > Unique variance > > > > --------------------------------------------------------------------------------------- > > Les cinq coeff. intra-class > >

-- \\\|/// \\ - - // ( @ @ ) +-----oOOo-(_)-oOOo-------+--------------------------------------+ | Bernard Tremblay | | | La Capitale | Tel: (418) 646-2401 | | | Fax: (418) 646-5960 | | | Int: Bernard.Tremblay@capitale.qc.ca | +-------------------------+--------------------------------------+ | Imaginasys enr | Res: (418) 658-1411 | | | Int: bertrem@quebectel.com | +--------------Oooo-------+--------------------------------------+ oooO ( ) ( ) ) / \ ( (_/ \_)


Back to: Top of message | Previous page | Main SAS-L page