Logic Structure


Logic statements are used to write specifications for tables and banners. Logic statements tell WinCross where a particular variable is located and define the criteria for tabulation. ** Logic permits up to 1024 characters per line. Logic statements are used in Setup|Tables and Setup|Express Tables from Variable Data to define rows (each line of a table) and filters (the base for each table). Logic is also used in Setup|Banners and Setup|Banner Templates from Variable Data to define banner columns. In Setup|Glossary Variables you can also use logic to DECLARE, DEFINE, RECODE, ASSIGN and COMPUTE variables to produce a revised data file.

The following are term definitions used interchangeably in WinCross documentation:

Record is used interchangeably with “card.”

Case is used interchangeably with “respondent.”

Position is used interchangeably with “column” and means a single location in the data file.

Field (in reference to logic) means one or more contiguous positions that represent a variable. The term width refers to the number of contiguous positions within a field.

Value means the contents of a variable, which could be the answer to a question, a code that represents the answer to a question or a computed value.

Variable means a piece of data. For example, “GENDER” is a variable.

Logic for Table and Banner Specifications

When using an ASCII fixed file, the location of every variable to be used in your tables must be defined by a record and position location. Variables from Excel, SPSS and other variable formats are defined using variable names. Logic statements are used to define table rows, filters and banner columns.

View|Data File Information provides information about your data file that can be helpful when writing logic statements.

** WinCross logic using variable names is converted to record/column location when evaluating the length. In most cases the 1024 character logic limit when converted to record/column location will be different than the original number of characters using variables names. If the record/column location conversion results in more than 1024 characters, a syntax error will be issued indicating the logic is more than 1024 characters.

Related topics:

Basic syntax


Logic Examples