user1130613
user1130613

Reputation: 13

How to use SPSS Syntax to edit Page Attributes and Page Set Up

I'm writing a macro in SPSS syntax to generate a large number of reports. I need the macro to export each report (which is in a output file) to a pdf file, but I cannot find any way of editing the output options of a pdf using syntax.

All I need to do is add a heading, footer and change the orientation to landscape. However this would be done in GUI by using Page Attributes and Page Set Up, neither of which seem to have any syntax equivalent?

I'm open minded to solutions in any form - but they must be able to work in an SPSS macro which tends to limit my options!

Upvotes: 1

Views: 2039

Answers (1)

JKP
JKP

Reputation: 5417

First, output settings are the domain of scripting. You won't find traditional syntax for most of that. However, you can install the STATS OUTPUT ATTRS extension command from the SPSS Community website (www.ibm.com/developerworks/spssdevcentral) in order to have a syntax way of doing this. It requires the Python Essentials, which are also available from that site.

Here is the beginning of the help text for this command.

This command sets options for printed or exported output. It has no effect on the display in the Viewer.

STATS OUTPUT ATTRS HEADER="header text" FOOTER = "footer text" MARGINS=left right top bottom ORIENTATION={PORTRAIT | LANDSCAPE} PAGENUMBER=number ITEMSPACING=number [/HELP]

All keywords are optional.

Second, you might want to consider using programmability instead of macro. It is much more flexible and powerful. You can explore this via the Programming and Data Management book downloadable as a pdf from the same website. And, depending on the reason for generating all these tables, you might be interested in the SPSSINC SPLIT DATASET and SPSSINC PROCESS FILES extension commands from the site.

HTH, Jon Peck

Example: STATS OUTPUT ATTRS HEADER="My Header Text" ORIENTATION=LANDSCAPE.

Upvotes: 2

Related Questions