SPSS Statistics

Expand all | Collapse all

processing many files with the production facility

  • 1.  processing many files with the production facility

    Posted Thu January 14, 2021 07:24 PM

    Hello,

     

    I need to run dozens SPS files, preferably in batch mode. I see there is the production facility, but from what I can tell, I need to add these files one by one. Any other suggestions? I tried figuring how to run from the command prompt, but all roads lead back to the production facility...

     

    Thanks!

     



    This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


    Thank you for your compliance.




  • 2.  RE: processing many files with the production facility

    Posted Thu January 14, 2021 08:47 PM
    You might consider the SPSSINC PROCESS FILES extension command.  It applies a syntax file to a batch of data fies that can be specified as a list or a file wildcard.

    If your problem is many syntax files rather than many data files, consider just making a file listing all of these and use the INSERT command to run them.

    --





  • 3.  RE: processing many files with the production facility

    Posted Fri January 15, 2021 12:25 AM
      |   view attached
    Attached please find a ZIP containing a bash script I wrote (this evening) that does what I think you want. It also has a template SPJ file that you will need.

    It should be easy to configure. Just set the arguments at the top of the script to the paths you want to read syntax files from and the path where you want the results. The output can be SPV or TXT. Also, point the template argument to the attached SPJ file.

    Any questions, let me know.


    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------

    Attachment(s)

    zip
    prod.zip   2 KB 1 version


  • 4.  RE: processing many files with the production facility

    Posted Fri January 15, 2021 09:37 AM

    Thank you Rick. I am not familiar with bash scripts, and could not find much info on SPSSINC PROCESS FILES. Instead I went over to SAS and created one very long syntax that included the 77 versions and used that instead.

    Thanks for your helps anyway.

     



    This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.


    Thank you for your compliance.







  • 5.  RE: processing many files with the production facility

    Posted Fri January 15, 2021 01:20 PM
    hello,

    want to follow up on this, and perhaps raise a different issue. the "dozens of sps files" i referred to in the original message were dozens of calls to the same macro. the macro receives many parameters, but one of them is the file name where to find the data (see "file" argument in macros below).
    i was initially trying to call the macro iteratively, but was getting messages related to invalid characters in a command. specifically the "\" that is part of the directory where the file is located. so instead i opted for writing individual syntax files and tried to send them through the production facility.

    however, i came back to trying to call the macro iteratively within another macro, and came across the following. below, !mac1 is the macro i want to call iteratively. and it works. when i call it within !mac2, where !file is "hard coded" within the macro, i get warnings about the "\", but !mac2 the macro actually does what i expect it to do. when i call it within !mac3 where i send !file as a parameter it also works and i get no warnings. i include below the code to replicate the behavior.

    define !mac1 (var = !charend('/') /
    file = !charend('/') ).
    echo !quote(!concat(!var," in file ",!file)).
    !enddefine.
    !mac1 var = v / file = c:\temp\dir.

    echo "* *".
    echo "Now process MAC2".
    * this one gives me a warning, but ends up working...
    define !mac2 (vars = !charend('/')).
    !do !v !in(!vars)
    !mac1 var = !v / file = c:\temp\dir.
    !doend
    !enddefine.
    !mac2 vars = a b c.

    echo "* *".
    echo "Now process MAC3".
    * this one works no problem.
    define !mac3(vars = !charend('/') /
    file = !charend('/') ).
    !do !v !in(!vars)
    !mac1 var = !v / file = !file.
    !doend
    !enddefine.
    !mac3 vars = x y z / file = c:\temp\dir.









    ------------------------------
    Eugenio Gonzalez
    ------------------------------



  • 6.  RE: processing many files with the production facility

    Posted Tue January 19, 2021 09:34 AM
    I noticed that the file paths/names in the macro calls are not quoted.  That can be a problem.  File specs should always be in quotes even though sometimes they are not necessary.

    ------------------------------
    Jon Peck
    ------------------------------