Stand-alone HDS programs will typically have the following structure:
<declarations>
INCLUDE 'SAE_PAR'
INCLUDE 'DAT_PAR'
INCLUDE 'DAT_ERR'
INCLUDE 'CMP_ERR'
STATUS = SAI__OK
<executable statements>
END
Various symbolic names should be used for important constant values in HDS programs to make the programs clear, portable and to insulate them from possible future changes. These symbolic names are defined by several Fortran "include" files. This explains the existence of the INCLUDE statements in the example above. The following include files are available:
If it is required to test for specific error conditions, the
appropriate include file should be used and the symbolic names (listed
in Appendix ) used in the test. Here is an
example of how to use these symbols:
INCLUDE 'SAE_PAR'
INCLUDE 'DAT_PAR'
INCLUDE 'DAT_ERR'
...
CHARACTER * ( DAT__SZLOC ) LOC1, LOC2
CHARACTER * ( DAT__SZNAM ) NAME
INTEGER STATUS
...
* Find a structure component.
CALL DAT_FIND( LOC1, NAME, LOC2, STATUS )
* Check the status value returned.
IF ( STATUS .EQ. SAI__OK ) THEN
<normal action>
ELSE IF ( STATUS .EQ. DAT__OBJNF ) THEN
<take appropriate action for object not found>
ELSE
<action on other errors>
END IF
HDS Hierarchical Data System