Users whose programs have called a PAR_PUT routine are often surprised to be prompted for ‘a parameter value’. This appendix is an attempt to clarify what is happening and what to do about it.
When the parameter system is asked for the value of a parameter of primitive type, the question it asks of the user via the Interface File) is not actually “What is the value of this parameter?” but “Where is the value of this parameter stored?”. If the parameter system is provided with an HDS object name, the correspondence between the question and the answer is obvious. However, if a primitive constant is provided, the correspondence is not so clear. What is happening is that providing a primitive constant actually means “Store the given value in the program’s parameter file9, creating a component of appropriate name, type and size if necessary, and tell the parameter system where it is.”. The program side of the parameter system then gets the value from where it is stored and delivers it to the program.
When a parameter value is to be output, the parameter system asks exactly the same question. Remembering that the prompt is actually for a location and not a value, the reason for the prompt is clearer.
It may be that output is required into some specific HDS object in which case its name may be specified in the normal way. (The object must exist and be of appropriate type and size.)
More often, the user just wants the parameter value to be put into the program’s parameter file (possibly to update the GLOBAL parameter file eventually). There are various ways of specifying the VPATH in order to obtain this effect.
It is possible to be prompted and respond with a primitive value of an appropriate type. This will create a parameter file component of the correct type, in the same way as when a parameter value is ‘got’, and tell the system that the parameter file is to be used for the ‘put’. (The actual value doesn’t matter as it will be overwritten by the ‘put’; the size and shape of the component will be changed if necessary. However, it is more efficient to specify the correct size if possible.)
If you do not want to be prompted for the parameter, the simplest way is to use the DEFAULT field.
where value
is a primitive value of an appropriate type. Again the size does not matter (apart from
efficiency), it will be changed if necessary.
9Or, in the case of scalar internal parameters, in memory