Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

## Purpose

nag_file_set_unit_advisory (x04ab) returns the value of the current advisory message unit number, or sets the current advisory message unit number to a new value.

## Description

nag_file_set_unit_advisory (x04ab) enables those library functions which output advisory messages to determine the number of the output unit to which the advisory messages are to be sent; in this case nag_file_set_unit_advisory (x04ab) is called with iflag = 0${\mathbf{iflag}}=0$. nag_file_set_unit_advisory (x04ab) may also be called with iflag = 1${\mathbf{iflag}}=1$ to set the unit number to a specified value. Otherwise a default value is returned.
Records written to this output unit by other library functions are at most 120$120$ characters long (including a line-printer carriage control character), unless those library functions allow you to specify longer records.
Note that if the unit number is set < 0$\text{}<0$, no messages will be output.

None.

## Parameters

### Compulsory Input Parameters

1:     iflag – int64int32nag_int scalar
The action to be taken (see nadv).
Constraint: iflag = 0${\mathbf{iflag}}=0$ or 1$1$.
If iflag = 0${\mathbf{iflag}}=0$, nadv need not be set.
If iflag = 1${\mathbf{iflag}}=1$, nadv must specify the new advisory message unit number.

None.

None.

### Output Parameters

If iflag = 0${\mathbf{iflag}}=0$, nadv is set to the current advisory message unit number.
If iflag = 1${\mathbf{iflag}}=1$, nadv is unchanged.
Note that Fortran unit numbers must be positive or zero. If nadv is set < 0$\text{}<0$, output of advisory messages is totally suppressed.

None.

## Accuracy

Not applicable.

The time taken by nag_file_set_unit_advisory (x04ab) is negligible.

## Example

```function nag_file_set_unit_advisory_example
iflag = int64(1);
```
```

6

```
```function x04ab_example
iflag = int64(1);
```