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 with Natural for Mainframes.

This document covers the following topics:


What are Resources?

Resources are non-Natural 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.

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 uppercase.

Resource Long Name

A resource long name is stored in the third directory records of the resource using the following 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

Storage of Resources

Objects of type resource are stored in libraries in the same way as the other Natural object sources.

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 or delete a resource by using short or long name.