Controlling Whether FIXFORM Input Fields Are Conditional

How to:

Reference:

In MODIFY, by default, FIXFORM FROM mastername treats all transaction data as conditional, meaning that space-filled fields are considered not present, and as such cannot be updated or used in updates.

The SET FIXFRMINPUT command enables you to specify how to handle FIXFORM input fields as either conditional (field/format C) or non-conditional fields. Thus, spaces in a transaction field can be used for updating database fields.


Top of page

x
Syntax: How to Control Whether FIXFORM Input Fields Are Conditional
SET FIXFRMINPUT = {COND|NONCOND}

where:

COND

Treats all transaction fields generated by FIXFORM FROM mastername as conditional (format C) fields. COND is the default value.

NONCOND

Treats all transaction fields as present in the transaction, and their contents are treated as real values.

Note that if you have not changed the value of the FIXFRMINPUT parameter and you query its value, the value displays as DEFAULT.


Top of page

x
Reference: Usage Notes for SET FIXFRMINPUT


Example: Controlling Whether FIXFORM Transaction Fields Are Conditional

The following procedure establishes a transaction file, defining LN1 in HOLD file TRANS to be blank for PIN 000000040.

SET ASNAMES = ON
DEFINE FILE EMPDATA
LN1/A15 = IF PIN EQ '000000040' THEN '' ELSE LN;
END
TABLE FILE EMPDATA
PRINT PIN LN1 AS LN
IF PIN FROM '000000010' TO '000000100'
ON TABLE HOLD AS TRANS
END

The following procedure, sets the FIXFORM FROM input fields as conditional (the default) and reports on the output from the MODIFY:

SET FIXFRMINPUT = COND
-? SET FIXFRMINPUT &FIXF
 
MODIFY FILE EMPDATA
 FIXFORM FROM TRANS
 MATCH PIN
  ON MATCH UPDATE LN
  ON NOMATCH REJECT
 DATA ON TRANS
END
 
TABLE FILE EMPDATA
HEADING
" "
"VALUE OF FIXFRMINPUT IS &FIXF "
" "
PRINT PIN LN
 IF PIN FROM '000000010' TO '000000100'
END

The output shows that the blank in the transaction file was not used to update the last name in the data source:

 VALUE OF FIXFRMINPUT IS COND
 
PIN        LASTNAME
---        --------
000000010  VALINO
000000020  BELLA
000000030  CASSANOVA
000000040  ADAMS
000000050  ADDAMS
000000060  PATEL
000000070  SANCHEZ
000000080  SO
000000090  PULASKI
000000100  ANDERSON

The following procedure sets the FIXFORM FROM input fields as non-conditional and reports on the output from the MODIFY:

SET FIXFRMINPUT = NONCOND
-? SET FIXFRMINPUT &FIXF
 
MODIFY FILE EMPDATA
 FIXFORM FROM TRANS
 MATCH PIN
  ON MATCH UPDATE LN
  ON NOMATCH REJECT
 DATA ON TRANS
END
 
TABLE FILE EMPDATA
HEADING
" "
"VALUE OF FIXFRMINPUT IS &FIXF "
" "
PRINT PIN LN
 IF PIN FROM '000000010' TO '000000100'
END

The output shows that the last name for PIN 000000040 has been updated to contain blanks:

 VALUE OF FIXFRMINPUT IS NONCOND
 
PIN        LASTNAME
---        --------
000000010  VALINO
000000020  BELLA
000000030  CASSANOVA
000000040
000000050  ADDAMS
000000060  PATEL
000000070  SANCHEZ
000000080  SO
000000090  PULASKI
000000100  ANDERSON

Information Builders