Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 - Asset Console Creating an Access Definition File Guide


$FILEOPEN (open file)

$FILEOPEN declares the start of editing of a file to which data is to be output.

Organization of this page

Syntax

file-object=$FILEOPEN(file-name,mode)

Values

Status

The following table lists and describes the possible statuses:

Status

Description

NORMAL

Normal end

NODATA

ERROR

Script execution interrupted

Indicates one of the following:

  • The file specified by file-object does not exist.

  • An invalid mode was specified.

  • An error occurred when an attempt was made to open the file (for example, the file is locked).

  • An invalid argument was specified, or an error other than the above occurred.

Legend:

—: Not applicable

Example

The following example creates the file output.csv, and outputs to that file "Asset ID","Asset No","Asset status","Asset type":

[SET_VALUE]
  FH = $FILEOPEN('output.csv', RENEW)
 
  $SETARRAY(OUTLINE,'Asset ID')
  $SETARRAY(OUTLINE,'Asset No')
  $SETARRAY(OUTLINE,'Asset status')
  $SETARRAY(OUTLINE,'Asset type')
 
  $FILEARRAY(FH, OUTLINE)
  $CLEARARRAY(OUTLINE)
 
  $FILECLOSE(FH)
Execution result:

The following is output to output.csv:

"Asset ID","Asset No.","Asset status","Asset type"