|
Hey! Can somebody to help solution for this problem. I have macro in with need to include some new values from macro into macros. define pinclu() "c:\juris\macros.sps" !end. define !apint2() !do !np=1 !to !eva(!maks). get file=!pathl36. do if (npk=!np). write out=!includ /"set err=off." /"define !gads() " gads " !end." /"define !men() " men " !end." /"define !reize() " reize " !end." /"define !nr() " nr " !end." /"set err=on.". end if. exe. data list free /a(f1). begin data. end data. include file=!includ. include file=!pinclu. !doend. !end. set err=on. With best regards, Juris |
|
At 12:13 PM 3/2/2009, Juris Breidaks wrote:
I have macro in with need to include some new values from macro into macros. The problem is those two include lines I've emphasized. You want them executed when the macro is run, to include the text you just wrote out to the file; but "INCLUDE" is executed when the code is first processed -- i.e., when the macro is defined. You're getting either the file without what you've written to it, or an error saying the file doesn't exist. Inside your loop, write all the code to your "include" file, then include it once outside the macro, after invoking the macro. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
In reply to this post by Juris Breidaks
Hi!
-I would recommend to switch to Python. It's easier and infinitely more flexible. -Is "!end" allowed? I'd say it's "!enddefine" -You should use !if-!then-!ifend rather than DO IF. -set mprint = on helps diagnosing problems. Cheers!! Albert-Jan --- On Mon, 3/2/09, Juris Breidaks <[hidden email]> wrote: > From: Juris Breidaks <[hidden email]> > Subject: Error in macros! > To: [hidden email] > Date: Monday, March 2, 2009, 6:13 PM > Hey! > > Can somebody to help solution for this problem. > > I have macro in with need to include some new values from > macro into > macros. > > > define pinclu() "c:\juris\macros.sps" > !end. > > define !apint2() > !do !np=1 !to !eva(!maks). > get file=!pathl36. > do if (npk=!np). > write out=!includ > /"set err=off." > /"define !gads() " gads " !end." > /"define !men() " men " !end." > /"define !reize() " reize " !end." > /"define !nr() " nr " !end." > /"set err=on.". > end if. > exe. > data list free /a(f1). > begin data. > end data. > include file=!includ. > include file=!pinclu. > !doend. > !end. > set err=on. > > > With best regards, > Juris ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
|
Dear all,
Could somebody please tell me why this is happening? This dataset is both open and activated. DATASET CLOSE Hoofd.sav. Warnings
Lots of TIA and best regards from the Netherlands! Ruben v.d. Berg Express yourself instantly with MSN Messenger! MSN Messenger |
|
"Hoofd.sav." looks like part of the filespec (name in the OS). click on the "windows" tab to see what files you have open. Art Ruben van den Berg wrote: Dear all,
Art Kendall
Social Research Consultants |
|
click <help> click <tutorials> Click <working with multiple data sources>. when done with that click <help> click <topics> click <search> type "dataset" in the edit box. Art Kendall Social Research Consultants Ruben van den Berg wrote: Dear Art, |
| Free forum by Nabble | Edit this page |
