Process Help

SELCOP - selectively copy named fields from one file to another

 

Process Name

Menu Path

Link to Command Table

SELCOP

Data ribbon | Data Tools | Tables | Copy Fields

Click here

 

Introduction

Selectively copies named fields from the input file to the output file.

How to use

The required fields are specified as *F1 to *Fn. Any number of required fields may be chosen, but only one is compulsory.

If retrieval criteria are specified they will be ignored if they are not on the chosen fields. To select records on fields which are not required in the output file requires a two stage process - first COPY under retrieval criteria, then SELCOP the required fields.

If the optional parameter @KEEPALL is zero (default) the output file will only contain one entry for each combination of output field values, provided that the input file is first sorted on these fields. If the input file is not sorted, then the output file will contain one entry for each combination of output field values which occur together in the input file.

The process works by checking the selected field values against the values just written to the output file. If they are identical, the current record is skipped.


Files, Fields and Parameters

Input Files

Name

Description

I/O Status

Required

Type

IN

Input file.

Input

Yes

Table

FIELDLST

File to supply selected fields.

Input

No

Undefined

Output Files

Name

I/O Status

Required

Type

Description

OUT

Output

Yes

Table

Output file with selected fields.

Fields

Name

Description

Source

Required

Type

Default

F1

Selected field 1.

IN

Yes

Any

Undefined

F2

Optional second selected field.

IN

No

Any

Undefined

F3

Optional third selected field.

IN

No

Any

Undefined

F4

Optional fourth selected field.

IN

No

Any

Undefined

F5

Optional fifth selected field.

IN

No

Any

Undefined

F6

Optional sixth selected field.

IN

No

Any

Undefined

F7

Optional seventh selected field.

IN

No

Any

Undefined

F8

Optional eighth selected field.

IN

No

Any

Undefined

F9

Optional ninth selected field.

IN

No

Any

Undefined

F10

Optional tenth selected field.

IN

No

Any

Undefined

F11

Optional eleventh selected field.

IN

No

Any

Undefined

F12

Optional twelfth selected field.

IN

No

Any

Undefined

F13

Optional thirteenth selected field.

IN

No

Any

Undefined

F14

Optional fourteenth selected field.

IN

No

Any

Undefined

F15

Optional fifteenth selected field.

IN

No

Any

Undefined

F16

Optional sixteenth selected field.

IN

No

Any

Undefined

F17

Optional seventeenth selected field.

IN

No

Any

Undefined

F18

Optional eighteenth selected field.

IN

No

Any

Undefined

F19

Optional nineteenth selected field.

IN

No

Any

Undefined

F20

Optional twentieth selected field.

IN

No

Any

Undefined

F21

Optional twenty first selected field.

IN

No

Any

Undefined

F22

Optional twenty second selected field.

IN

No

Any

Undefined

F23

Optional twenty third selected field.

IN

No

Any

Undefined

F24

Optional twenty fourth selected field.

IN

No

Any

Undefined

F25

Optional twenty fifth selected field.

IN

No

Any

Undefined

FIELDNAM

Field in FIELDLST to identify selected fields.

FIELDLST

No

Character

Undefined

Parameters

Name

Description

Required

Default

Range

Values

KEEPALL

Option

Description

1

copy all records

(0)

ignore duplicate successive records.

No

0

0,1

0,1

KEYTOL

KEYTOL is the tolerance value used to test whether numeric key values are equal. It must be greater than or equal to zero. It replaces the previous heuristic comparison method.

If KEYTOL is set to a negative value then zero is used.

In a macro KEYTOL can be set to absent using -. "@KEYTOL=-" This will revert to legacy behaviour of a tolerance of zero being used.

No

0.00001

0,+

Undefined


Notes

If the input file is sorted on the selected fields, the result is that SELCOP is exactly equivalent to the relational 'projection' operation.


Example

!SELCOP     &IN(ASSAYS),&OUT(CUVALS),*F1(CU)


 Error and Warning Messages

Message

Description

Solution