Skip to main content

Data & Intelligence

IBM SPSS Syntax for File Operations

banner1

My start-up predictive analytics organization “Predictive Performers” wants to do some internal planning. We receive extract files from an an accounting service each month that provide the total hours billed per each of our consultants, along with each consultants hourly rate. The files are saved to a folder on our network:

networklocation

The files also breakout my “on staff” consultants as “fte=1”, so it would be interesting to see what we can compare between our full time analytic experts and our contractors.

fileJan

MATCH and AGGREGATE

Data Intelligence - The Future of Big Data
The Future of Big Data

With some guidance, you can craft a data platform that is right for your organization’s needs and gets the most return from your data capital.

Get the Guide

Using SPSS Syntax, a simple script can be used to automate the merging of these monthly files into a single “quarterly file” and then run a simple aggregation on the file producing some interesting results for the quarter. The script below uses the GET FILE to identify and sort each montly file, then MATCH FILES to perform the merging and finally AGGREGATE to produce some statistics.

aggregationsyntax

In this Syntax script, I’ve output the results to a merged quarter “aggregation” file that gives us a mean and median hourly rate by month for FTE’s and contractors. It also gives us a median for “total hours billed”:

aggregationfile

Here are the 2 new files – the “a” version contains the aggregated results.

finalfiles

Conclusion

Working your way through the SPSS Statistic menus gets old fast. This (very) simple example is an example of the efficiency and control that Syntax provides.

Remember “Scripts over Menus”!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Jim Miller

Mr. Miller is an IBM certified and accomplished Senior Project Leader and Application/System Architect-Developer with over 30 years of extensive applications and system design and development experience. His current role is National FPM Practice Leader. His experience includes BI, Web architecture & design, systems analysis, GUI design and testing, Database modeling and systems analysis, design, and development of Client/Server, Web and Mainframe applications and systems utilizing: Applix TM1 (including TM1 rules, TI, TM1Web and Planning Manager), dynaSight - ArcPlan, ASP, DHTML, XML, IIS, MS Visual Basic and VBA, Visual Studio, PERL, Websuite, MS SQL Server, ORACLE, SYBASE SQL Server, etc. His Responsibilities have included all aspects of Windows and SQL solution development and design including: analysis; GUI (and Web site) design; data modeling; table, screen/form and script development; SQL (and remote stored procedures and triggers) development and testing; test preparation and management and training of programming staff. Other experience includes development of ETL infrastructure such as data transfer automation between mainframe (DB2, Lawson, Great Plains, etc.) systems and client/server SQL server and Web based applications and integration of enterprise applications and data sources. In addition, Mr. Miller has acted as Internet Applications Development Manager responsible for the design, development, QA and delivery of multiple Web Sites including online trading applications, warehouse process control and scheduling systems and administrative and control applications. Mr. Miller also was responsible for the design, development and administration of a Web based financial reporting system for a 450 million dollar organization, reporting directly to the CFO and his executive team. Mr. Miller has also been responsible for managing and directing multiple resources in various management roles including project and team leader, lead developer and applications development director. Specialties Include: Cognos/TM1 Design and Development, Cognos Planning, IBM SPSS and Modeler, OLAP, Visual Basic, SQL Server, Forecasting and Planning; International Application Development, Business Intelligence, Project Development. IBM Certified Developer - Cognos TM1 (perfect score 100% on exam) IBM Certified Business Analyst - Cognos TM1

More from this Author

Follow Us