# Directives

SETDEV PROGRAM | Set I/O Program

## Formats

SETDEV (chan) PROGRAM {"prog_name" | "obj=…"}

Where:

chan | Channel or logical file number.
prog_name | Name of embedded I/O program.
obj=… | Object name.

## Description

The SETDEV PROGRAM directive allows an embedded I/O program to be attached to an open channel or object if the file does not already have one associated with it. The embedded I/O program will remain in effect only until the channel is closed.

(The ability to attach an object to the SETDEV PROGRAM directive was added in PxPlus 2016 Update 0003.)

## Example

load "Embedded.io"
list
! Embedded.io
Pre_Close:
print "This message generated by the Pre_Close routine"
open (1)"*msglib.en" ! Open a file
setdev (1) program "Embedded.io" ! Attach EIO program
close (1) ! Close the file
This message generated by the Pre_Close routine