Specifying File Layout, Record, and Field Properties

This section discusses how to:

  • Specify file layout properties.

  • Specify file record properties.

  • Specify file field properties.

Note: Some properties are available only for a specific file layout format. For example, a file definition tag is available only for an XML format file. When a property is available only for a particular format, the format is noted in parentheses after the name of the property (such as File Definition Tag [XML]).

Note: Each property that appears in the Preview tab of the File Layout Designer is only another view of the corresponding property of the same name that appears in the Properties dialog box when working with the Definition tab. Changing any property value in one view changes the same property value in another view.

Important! It is important to keep in mind that the information about file layout segments and file layout fields is stored in the database separately from the information about the associated records, record fields, and database fields. This separate storage can cause problems, for example, if the data type or size of a database field changes while the corresponding information about an associated file layout field remains unchanged. Another example might be if a record field is removed from a record while the corresponding file layout field remains in the associated file layout segment. Because of the potential for the file layout and the underlying database structure to diverge over time if changes are made to the system, it is very important (particularly after an upgrade) to confirm that each file layout segment be kept in sync with its associated record and that each file layout field be kept in sync with its associated database field.

The File Layout Definition Properties dialog box contains all of the information that is stored at the file layout (root) level.

Access the dialog box by using one of the following methods:

  • Select File > Object Properties.

  • Press the Alt+Enter keys.

  • Double-click the topmost (root) node of a file layout definition.

  • Right-click an open file layout and select Data Object Properties.

The General tab of the dialog box contains description information for the file layout. The Use tab contains specific information for the file layout:

Image: File Layout Definition Properties dialog box: Use tab

This example illustrates the fields and controls on the File Layout Definition Properties dialog box: Use tab. You can find definitions for the fields and controls later on this page.

File Layout Definition Properties dialog box: Use tab

Field or Control

Definition

File Layout Format

Displays the type of file layout. Values are FIXED, CSV, and XML.

File Definition Tag

Enter the XML tag name that is associated with this layout (or transaction). This tag can be 30 characters in length. This tag must be unique in the file layout.

This field is active when the file layout format is XML.

Note: If you leave this field blank, the system inserts <start> into the file as the default tag value. Enter any value to prevent the system from inserting the default <start> tag into the file.

Buffer Size

Displays the size of the input buffer that is used at runtime.

This field is active when the file layout format is XML.

Note: Do not edit this value directly.

Imply Decimal Place

Select to automatically add a decimal place based on the decimal value that is specified in the field definition when you import a file into a PeopleSoft database and no decimal place is specified for numeric values in the file.

If you select this option, make sure that the length that you specify for the Number field includes a decimal point, even though it is not visible. In this case, the decimal point is counted as a space. For each occurrence of numeric data that is missing a decimal point character in the input file, a space character is also required in the input file; locate the space character either immediately before the numeric characters or immediately after them.

This field is active when the file layout format is FIXED.

Excel Format

Select to parse the field by using Microsoft Excel CSV specifications.

This field is active when the file layout format is CSV.

Qualifier Optional

Select to parse the field based on delimiters. When a qualifier exists, the field is parsed by using a closing matched qualifier. The system ignores all characters before and after the qualifier.

This field is active when the file layout format is CSV.

If you do not select this check box, the field must have qualifier pairs. The system ignores all characters before and after the qualifier.

Convert Tabs to Spaces

Select to convert all tabs within the field to spaces. If you do not select this option, the system ignores all tabs.

This field is active when the file layout format is CSV.

Note: If the Strip White Space option is also selected, the system removes trailing and leading tabs.

Interpret Backslashes

Select to interpret backslashes within field data as escape characters.

The following characters have special meanings:

  • \t represents a tab.

  • \n represents a new line.

If you do not select this check box, the system considers backslashes to be regular text data.

This field is active when the file layout format is CSV.

Strip White Space

Select to remove all leading and trailing white space within field data from the output data.

This field is active when the file layout format is CSV.

Note: If you select this option, the system removes trailing and leading tabs, regardless of whether you selected the Convert Tabs to Spaces option.

Double Quote

Select to interpret two double quotes (" "), as one double quote (") in output data.

For example, if you enable this option, abc""def" is interpreted as abc"def.

This field is active when the file layout format is CSV.

Backslash Quote

Select to interpret backslash quotes (\") as one double quote (") in output data.

For example, if you enable this option, "abc\"def" is interpreted as abc"def.

This field is active when the file layout format is CSV.

The File Layout Segment Properties dialog box contains information that is stored at the file record level:

Image: File Layout Segment Properties dialog box: Use tab

This example illustrates the fields and controls on the File Layout Segment Properties dialog box: Use tab. You can find definitions for the fields and controls later on this page.

File Layout Segment Properties dialog box: Use tab

Access the dialog box using one of the following methods:

  • Double-click the file record node.

  • Right-click the file record node and select Selected Node Properties.

Field or Control

Definition

File Record Name

Enter a file record name that is associated with this file record. This name is used to access the file record from PeopleCode. Every file record in a file layout must have a unique name.

ID Seq No. (CSV) (identification sequence number)

Enter a sequence number for the field that contains the file record ID.

Max Rec Length (maximum record length)

Displays the default maximum length of the combined field sizes of the record. This value is automatically updated.

Warning! Any inbound or outbound data is truncated beyond this value.

File Record ID

Enter a number that uniquely identifies the file record in the file layout. You can use this number for processing the file. This number is automatically written to the file if you use the WriteRecord or WriteRowset methods and if the file type is FIXED or CSV.

ID Start Position (FIXED)

Enter the column or starting position in the file record where the file record ID starts.

ID Length (FIXED, CSV)

Displays the length of the file record ID. This number is automatically generated when you enter the file record ID.

Note: Do not edit this value directly.

Default Qualifier (CSV)

Enter a qualifier that is used for the file record ID and as the default for fields when no field qualifier is specified. This value overrides the definition qualifier that is specified in the File Layout Definition Properties dialog box. When you first create a file layout, this property is blank.

Seg Terminator (FIXED, CSV) (segment terminator)

Enter characters to be placed at the end of each segment when the layout is written to a file.

Note: The segment terminator of a file record isnot the same as its record terminator. The segment terminator occurs immediately after a single row of data; it is defined only at design time in the File Layout Designer. The record terminator occurs immediately after the segment terminator; it is defined only at runtime by the SetRecTerminator method of the File class.

See SetRecTerminator for more information on the SetRecTerminator method.

Field Delimiter (CSV)

Enter a delimiter that is used for all fields in the file record. This value overwrites the definition delimiter that is specified on the File Layout Definition Properties dialog box.

Record Tag (XML)

Enter an XML tag name for this file record. The default value is the file record name.

Note: Within a particular file layout, each record name and record tag must be unique.

Record Description

Enter a description of the record for documentation purposes only.

The File Layout Field Properties dialog box contains information that is stored at the file field level:

Image: File Layout Field Properties dialog box: Use tab

This example illustrates the fields and controls on the File Layout Field Properties dialog box: Use tab. You can find definitions for the fields and controls later on this page.

File Layout Field Properties dialog box: Use tab

Important! You must manually synchronize the file layout field properties with the related properties of any associated field definition. Unexpected results can occur when the properties are not synchronized. These properties are most likely to be unsynchronized immediately after an upgrade.

Access the dialog box using one of the following methods:

  • Double-click the file field node.

  • Right-click the file field node and select Selected Node Properties.

Most individual properties are usable by all field types. However, some are specific to a particular field type, for example, the Upper Case check box is applicable to character fields only, the Date Separator field is applicable to date fields only, and so on. The preceding dialog box shows the properties for a character type of field. The following descriptions include all possible properties.

Field or Control

Definition

Date Format (Date)

Select a date format, such as MMDDYY, DDYYMM, and so on.

Date Separator (Date)

Enter a character that is used to separate date values. The default value is /.

Decimal

Enter the number of decimal positions to the right of the decimal point. This property is valid only for fields that are defined as number or signed number.

Note: Only 31 characters plus a decimal point are allowed.

Default Value

Enter the default value to be used by a call to ReadRowset when the corresponding data is imported from a file via a file layout definition.

Note: You cannot use the system variables related to date and time (for example, %DATE, %TIME, %DATETIME) to specify the value of the default-value property of a file layout field.

The value of the default-value property of a file layout field has no relationship to the value of the default-value property of any corresponding record field (one having the same record name and field name). When data is imported from a file via a file layout definition, the value used for a file layout field that is empty in the input file is determined by the default value of the corresponding file layout field, not the default value of any corresponding record field (even if the value of the default-value property of the file layout field is empty and even if that record field is required).

Field Description

Enter a description of the field for documentation purposes only.

Field Inheritance

Optionally select a parent file record and field from which the current field value is to be inherited. If you write to a file, the value is written only in the parent file record, not in the child (inheriting) file record; the value is not written more than once to a file. If no value is present in the parent field, then the system uses the default value that is specified here.

For example, the following file sample shows both the EMPLID (8113) and EFFDT (08/06/1999) written only once to a file, though these fields are repeated in the third file record (with a file record ID of 102):

100 8113 Frumman,Wolfgang
101      08/06/1999     000001   219 Going to London office
102                 100 000015 I 08/06/1999
102                 200 000030 I 08/06/1999
102                 300 000009 I 08/06/1999
102                 400 000001 I 08/06/1999
102                 500 000011 I 08/06/1999
Field Name

Enter the name that is associated with this file field. Use this name when accessing the file field from PeopleCode. Every field within a file record must have a unique name; however, two different file records can contain the same file field.

Field Tag (XML)

Enter an XML tag name to be used around the field. The default value is the name of the field.

Note: Within a particular file record, each field name and field tag must be unique.

Field Type

Select the data type of the file field.

Length

Enter the maximum number of characters in this field.

Note: You are allowed only 32-character precision for number and signed number fields; that is, a total of 32 characters both to the right and left of the decimal. Other fields, such as character fields, can be longer.

You cannot set a field length for Date, Time, and Datetime type fields. These field lengths are automatically set to the ISO standards for such fields.

Pad Field (CSV)

Select to enable field padding. The field will be padded with space characters up to the value of the length property. Character data will be left justified, numeric data right justified.

Propagate (FIXED)

If a field position or length is changed, enter an amount here to increment (positive number) or decrement (negative number) the current field and all fields before it (<<<) or after it (>>>).

Qualifier (CSV)

Enter a qualifier for the field, that is, the character that surrounds this field, separating it from other fields. Specifying this value overwrites the value that is specified in the file layout properties and file record properties.

Start Position (FIXED)

Enter the starting position (column) of the field within the file record.

Important! If you specify a start position for a field that overwrites a previous field, no data is written to the file. Use Propagate to change the start positions for your file fields.

Strip Characters

Specify any characters to be removed from the input buffer. Use this field to preprocess input strings. For example, if a field in the input file contains hyphens but you want to remove the hyphens before processing the field, you can enter a hyphen here and it will be stripped out while being read. You can specify more than one character to be stripped out. Be sure to not separate the strip characters. For example, the following code strips out all semicolons and hyphens:

;-

The following code strips out all semicolons, hyphens, and spaces:

; -
Trim Spaces

Select to remove trailing spaces only from an input string. This option is active only for FIXED and CSV formats.

This option is different from the Strip Characters field, which removes all spaces from the entire input field if you specify a space.

UpperCase (Char)

Select to convert lowercase text to uppercase during inbound processing. Use this option primarily when customer data is in lowercase and the PeopleSoft software requires the data to be in uppercase.

Note: PeopleSoft applications do not accept numbers that contain thousand separators, as in "," or ".". For example, if you exchange data with Microsoft Excel, you need to disable the "Use 1000 Separator (,)" property.