Version 4.2.6 for Mainframes (Update)
 —  Programming Guide  —

Using Non-Natural Files - Resource

This section describes the Natural object of type resource.

Note:
In contrast to Natural for Open Systems, where shared and private resources are available, currently only shared resources are available in Natural for Mainframes.

This document covers the following topics:


What are Resources?

Resources are Natural external objects, like HTML pages, GIFs, etc. They are stored in libraries on the system file FNAT or FUSER for being accessible from within Natural applications.

Resources in their technical meaning are large data objects in binary or character format, which are processed either in a transient way or stored persistent as input to or result of a utility or user application run.

Top of page

Use of Resources

Objects of type resource are used by the XML Toolkit as containers for DTDs, XML schemas, style sheets, etc. The Natural Web Interface makes use of resources, such as GIFs or JPEGs. In addition, objects of type resource can be used to store XLIFF translation files.

The following topics are covered below:

Naming Conventions for Resources

Objects of type resource have a long name and a short name.

Resource Short Name

For each object of type resource an 8-byte object short name exists. This short name is in in upper case and can be specified in system commands, such as LIST, DELETE and RENAME, as well as in the Object Handler and the utilities INPL and SYSMAIN.

Resource Long Name

A resource long name is stored in the third directory records of the resource using the follwing structure:

Bytes Format Content
1 - 2 B2 Line number H'0000'
3 - 6 A4 Resource type, usually the extension of the resource name
7 A1 Resource format, where A = alphanumeric, B = binary, U = Unicode
8 - 252 A245 Resource name

The long name of a resource can be displayed using the system command LIST. It is shown in the List of Objects when you issue the function code LN.

Storage of Resources

Objects of type resource are stored in libraries in the same way as the other Natural programming object sources. They can be handled with the utilities SYSMAIN and INPL and with the Object Handler.

They cannot be edited with the Natural editors.

Top of page

API for Processing Resources

In the library SYSEXT, the following application programming interface (API) exists which gives user applications access to resources' unique user exit routines:

API Purpose
USR4208N Write, read, delete a resource by using short or long name.

Top of page