6. Form Description

This section describes the forms mechanism used to define the tracks to be read or written. Forms are contained in a single file, with one section for each defined form. The name of each section is the form name parameter in the WFS_CMD_IDC_READ_TRACK and WFS_CMD_IDC_WRITE_TRACK commands.

The currently active ID card unit (IDCU) form file is configured through the following key

WOSA/XFS_ROOT

FORMS

IDCU

formfile=<path><filename>

The read form defines which tracks should be read in the WFS_CMD_IDC_READ_TRACK command and what the response should be to a read failure. The read form can also be used to define logical track data, i.e. fields like “account number,” “issuer identifier,” and their position within the physical track data. For example, the output parameter of the WFS_CMD_IDC_READ_TRACK command with input parameter lpstrFormName = READTRACK3GERMAN could look like (see example 1 below):

"TRACK3:MII=59\0ISSUERID=50050500\0ACCOUNT=1234567890\0LUHNT3=1\0\0\0"

The write form defines which track is to be written, the logical track data that is handed over in the WFS_CMD_IDC_WRITE_TRACK command, and how the write data is to be converted to the physical data to be written.

Reserved Keywords/Operands Meaning

[] form name delimiters

TRACK1 keyword to identify track 1

TRACK2 keyword to identify track 2

TRACK3 keyword to identify track 3

FIELDSEPT1 value of field separator of track 1

FIELDSEPT2 value of field separator of track 2

FIELDSEPT3 value of field separator of track 3

READ description of read action; the TRACKn keywords are processed left to right

WRITE description of write action

ALL read or write the complete track

SECURE do the security check via the security module (CIM86 or MM)

& read/write all tracks specified, abort reading on read failure

| read/write at least one of the tracks specified, continue reading on read failure

FIELDSEPPOSn position of the nth occurrence of field separator on track

, separator in a list of logical fields

DEFAULT string for default substitution of track data to be written, that is not defined explicitly by the form fields. DEFAULT also allows an application to input fewer fields than those defined by the form.

? Reserved value for DEFAULT keyword: substitute track data to write with its value read before.

ENDTRACK is the reference to the end track position. It is used to identify fields positioned after the last field separator

Notes

The & and | operands may be combined in a single READ statement; for example:

Use of field separators in track layouts is to replace optional fields and terminate variable length fields.

Write forms are designed for updating specific fields without altering the position of the field separators.

The application may alter the position of the field separators by rewriting the card tracks (ALL option or DEFAULT option with default track data).

Example 1 Reading tracks:

[READTRACK3GERMAN]
 FIELDSEPT1= =   /* field separator of track 1 */
 FIELDSEPT2= =  /* field separator of track 2 */
 FIELDSEPT3= =  /* field separator of track 3 */
 READ= TRACK3 & TRACK1 & TRACK2  /* all tracks must be read */
TRACK3= MII, ISSUERID, ACCOUNT, LUHNT3, SECURE /* read logical fields as defined below; also check the security */
 MII= FIELDSEPPOS1 + 1, FIELDSEPPOS1 + 2 
 ISSUERID= FIELDSEPPOS1 + 3, FIELDSEPPOS1 + 10
 ACCOUNT= FIELDSEPPOS1 + 11, FIELDSEPPOS2 - 2
 LUHNT3= FIELDSEPPOS2 - 1, FIELDSEPPOS2 - 1
 TRACK2= ALL  /* return track2 complete, 
don't return logical fields */ TRACK1= ALL /* return track1 complete,
don't return logical fields */

All tracks must be read (‘READ’), that is, the read fails if an error occurs on reading any one of the tracks (the ‘&’ operand). The field “major industry identifier” (‘MII’) is located after the first field separator (‘FIELDSEPPOS1’) and its length is two bytes. The “issuer identifier” field (‘ISSUERID’) is located after the MII field, with a length of eight bytes. The next field, “account number” (‘ACCOUNT’) is variable length; it ends before the luhn digit field (‘LUHNT3’) that is the last digit in front of the second field separator (‘FIELDSEPPOS2’).

Example 2 Write a track:

[WRITETRACK3]
FIELDSEPT3=  =
DEFAULT= ? /* fields not specified in the write form are to be left unchanged, i.e., read and the same data written back to them */
WRITE= TRACK3
TRACK3= RETRYCOUNT, DATE
RETRYCOUNT= FIELDSEPPOS2, + 22, FIELDSEPPOS2 + 22
DATE= FIELDSEPPOS5 + 1, FIELDSEPPOS5 + 4

Track 3 is to be written. In the example only the retry counter and the date of the last transaction are updated, the other fields are unchanged. (If the field ALL is defined, the data passed in the WFS_CMD_IDC_WRITE_TRACK command is written to the physical track without formatting.)