How to automatically run several impu... PreviousNext
Mplus Discussion > Structural Equation Modeling >
Message/Author
 arcis_pau@yahoo.co.uk posted on Wednesday, June 06, 2012 - 7:44 am
Is it possible to have a master mplus .imp file that calls up a number of .imp files which define different SEM model? If so, how do I specify it?
 Linda K. Muthen posted on Wednesday, June 06, 2012 - 8:33 am
One way to do this is to use a DOS bat file. Go to the command prompt and create a file with the following commands:

call Mplus inp1.inp
call Mplus inp2.inp
etc.

The file extension should be .bat, for example, input.bat. To run the file type input at the command prompt.
 arcis_pau@yahoo.co.uk posted on Wednesday, June 06, 2012 - 9:22 am
Thanks Linda - It works perfectly!
 arcis_pau@yahoo.co.uk posted on Thursday, June 14, 2012 - 2:22 am
Could you do something similar when running the Linux version? I had to switch as I am on a new server...

Many thanks
 Linda K. Muthen posted on Thursday, June 14, 2012 - 11:30 am
Yes, you can create a text file with a list of commands to execute. Then you have to make the file an executable by using the "chmod" command. That makes the file an executable and then you can run it at the prompt and it will execute all the commands in the file.
 arcis_pau@yahoo.co.uk posted on Friday, June 15, 2012 - 3:04 am
Thank you for your prompt reply.
 Stephus Daus posted on Sunday, June 01, 2014 - 3:57 am
How about nested input files? In a complex setup you don't want to repeat all the changes for each file. I.e. is it possible to place all the Data: Variable: and Analysis: in a master file, and the Model: in the model files? [if not, I suggest put it on your to-do list]
 Linda K. Muthen posted on Sunday, June 01, 2014 - 10:00 am
This feature is not currently available. We will add your request to our list.
 Yue Yin posted on Thursday, September 13, 2018 - 12:15 pm
Hi,

If I want to use the SAS to create a batch file, and call the Mplus in the batch file. And run those steps in the Linux, how should I do it? I have already created the batch file, the problem is that I submit the .sh file to run SAS, and I am able to run .bat file I created in SAS in linux, but how should I call Mplus?
I tried to put module load apps/mplus/8, in both SAS, batch, and .sh, they all fail to run the mplus. Do you have any idea for it?

Thank you.
 Linda K. Muthen posted on Friday, September 14, 2018 - 11:25 am
Have you tried that syntax on the command line? What you put into the batch file should be the same as what works on the command line. If the Mplus program directory is on the path, then the usual syntax is

mplus input.inp

I’m not familiar with SAS and “module load” command.
 Yue Yin posted on Friday, September 14, 2018 - 11:41 am
The model load is the command which I use to load mplus in the Linux setting. And what command line you talking about? I put something like this in the batch "mplus ...inp ...outp" So I can call the mplus and run the inp file and provided the outputfile.

But the question is I can't call mplus using linux. If I put "mplus", the linux said the Mplus can't be located. But if I tried the same thing in the windows, it is gonna work.
 Thuy Nguyen posted on Friday, September 14, 2018 - 1:45 pm
The "mplus" command is not recognized because the Mplus program folder is not included in your path. You can try referring to the full path of the mplus command. On my computer, Mplus is installed in /opt/mplus/8.1 so I would access the command as follows:

/opt/mplus/8.1/mplus inpfile outfile
 Yue Yin posted on Friday, September 14, 2018 - 2:14 pm
Thank you! But I tried as you suggested, put /apps/mplus/8/mplus inpfile outfile, the Linux gave the following errors, do you know what is it?

/apps/mplus/8/mplus: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /apps/mplus/8/mplus)
 Thuy Nguyen posted on Friday, September 14, 2018 - 3:00 pm
Version 8 required GLIBC 2.14. You should update to Version 8.1. We made the change so that it works with GLIBC 2.12.
 Yue Yin posted on Friday, September 14, 2018 - 3:12 pm
Thanks, do you know how to make change to work with 2.12?
Back to top
Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: