Process Help

SETVAL - set values into given field of a file

 

Process Name

Menu Path

Link to Command Table

SETVAL

Data ribbon | Data Tools | Set Value (top level icon)

Click here

 

Introduction

Inserts a user-defined value into a given field either during copying of a file or as an in-place operation.

How to use

If done during a copy, the field will contain the given value in every record in the output file. If done in-place, retrieval criteria may be used if desired to allow insertion of the value into only some of the records of the file, thus provided a selective replacement capability.


Files, Fields and Parameters

Input Files

Name

Description

I/O Status

Required

Type

IN

Input file.

Input

Yes

Table

Output Files

Name

I/O Status

Required

Type

Description

OUT

Output

Yes

Table

Output file. If this is the same file as the input, then values will be set in place.

Parameters

Name

Description

Required

Default

Range

Values

MULTIFLD

Allow multiple field names to be specified if non-zero (0). Up to 20 fields can be supplied.

The ! character should be entered to terminate multi-field entry.

No 0 0,1 0,1

Notes

1.  

If retrieval criteria are used during a file copy, i.e. where the &OUT file is not the same as the &IN file, then the output file will only contain those records that were selected from the input file using the retrieval criteria.

2.  

Interactive prompts:

  

>FIELD  

 Name of field in the file for which a value will be set.

  

>VALUE  

 Value to be set into the given field name. If the value is alphanumeric, then this must be an alphanumeric string (not in quotes). If the field is numeric, then this must be a number.

 


Example

Example 1

Set to absent data all those values of the  field Ag, where X=35 and Au>.1<10.

!SETVAL

&IN(Assays),&OUT(Assays)
FIELD >Ag
VALUE >-
X=35,Au>.1<10

 

In this example, the &IN file is the same as the &OUT file, so replacement will be in-place.

Example 2

Set multiple fields in each record of file Assays that satisfies the same criteria as example 1.

!SETVAL

X=35,Au>.1<10,&IN(Assays),&OUT(Assays),@MULTIFLD=1
FIELD >Ag
VALUE >-
FIELD >Cu
VALUE >-
FIELD >Pb
VALUE >-
FIELD >!


Error and Warning Messages

Message

Description

Solution