Batch Utilities

This section describes the batch utilities provided with Super Natural.

This section covers the following topics:


What are Batch Utilities?

Super Natural provides the following batch utilities:

Batch Utility Description
SNULD Unloads profile data and transaction specifications
SNLOAD Loads profile data and transaction specifications
SNDELUF Deletes user files
SNSORTFI Sorts file links in user profiles

Unloading and Loading Super Natural Data

You use the utilities SNULD and SNLOAD to copy Super Natural user profile data, file profile data, help texts, and transaction specifications between different Natural user system files (FUSER). You can also use SNULD to delete profile data and help texts.

Notes:

  1. You cannot load help texts from Super Natural 2.3 to a Super Natural 3.1 environment.
  2. Do not use the Natural utilities SYSMAIN or SYSMAIN2 to copy or move Super Natural transactions between system files. These utilities only copy up to 80 characters per source line and Super Natural specifications contain up to 250 characters per line.
  3. The FDIC file in the target environment must be the same as that in the original environment if you want to use existing transactions.

Use the Natural Object Handler to copy or move JCL members, prototype programs and objects between system files.

For further information on SNULD and SNLOAD, see the following sections.

SNULD

The program SNULD in library SYSSN unloads Super Natural user profile data, file profile data, help texts and transaction specifications from the current Natural user system file (FUSER) to sequential work file 4 in a form suitable to be reloaded using the program SNLOAD.

The following table shows which functions are available for batch jobs using SNULD and which parameters are required:

Function Code Object Name Language Code Library
*      
D Required    
F Optional    
H Optional Optional  
S Required   Required
U Optional    

Functions

* Function

The * function unloads all user and file profiles and help texts. It does not unload transactions.

D Function

The D function deletes objects according to the object name parameter specified. You can use the following object name parameters with the D function:

* File profile data, user profile data and help texts
F File profile data
H Help texts (language specific)
U User profile data

All objects of the type specified are deleted.

F Function

The F function unloads either all file profiles (including user file and superfile profiles) or named file profiles. It does not unload the sources (transaction specifications) of superfiles.

H Function

The H function unloads either all or named help texts either in all languages or in a specified language.

Note:
You cannot load help texts from Super Natural 2.3 to a Super Natural 3.1 environment.

S Function

The S function unloads transaction specifications. It does not unload the generated source code and the Natural object code. To regenerate the Natural source and object code, you must modify and save every transaction.

You can also use SYSMAIN to copy the transaction objects, so the transactions can be run immediately in the new environment.

If you do not specify a transaction name and library name containing the appropriate prefix, all transaction specifications and layouts from all libraries are unloaded.

If you use the asterisk notation (*) following the prefix, all transaction specifications and layouts or libraries with that prefix are unloaded.

U Function

The U function unloads either all or named user profiles.

Parameters

Parameters must be entered after the function code in the following order:

function-code,object-name,language-code,library

The parameters must be separated from the code and from one another by the Natural delimiter character. If one of the parameters is not specified, or not applicable, the character preceding it is still required. For example, if you want to unload all English help texts, the parameters must be specified as: H,,1

You can use the asterisk notation with the parameters to further limit the object name and library of the items to be unloaded. For example the notation S,TR*,,Y* would unload all transactions whose name begins with TR in the library with prefix "Y".

Each function must be written on a separate line (along with its parameters).

Examples of Recommended Syntax

Example 1

LOGON SYSSN
SNULD
H,,1
S,TR*,,Y*
.
FIN

1: Unloads all English help texts.

2: Unloads all transactions whose names start with TR in libraries with the prefix Y.

Example 2

LOGON SYSSN
SNULD
S,*,,Y*
.
FIN

Unloads all transactions in all private libraries with the prefix Y.

Example 3

LOGON SYSSN
SNULD
S,IPGMNAME,,YUSERID
.
FIN

Unloads the specified transaction in the library given.

Example 4

LOGON SYSSN
SNULD
S,I*,,YUSERID
.
FIN

Unloads all transactions in the specified library whose name start with I.

Example 5

LOGON SYSSN
SNULD
S,*,,YUSERID
.
FIN

Unloads all transactions in the specified library.

Example 6

LOGON SYSSN
SNULD
F,*
S,*,,public-library-prefixSUPFILE
.
FIN

1: Unloads all file profiles including user file and superfile profiles.

2: Unloads the sources (transaction specifications) of the superfiles.

SNLOAD

The program SNLOAD in library SYSSN loads Super Natural user and file profile data, help texts and transaction specifications from sequential work file 4 to a user system file (FUSER). The data must be in the same format as achieved by unloading Super Natural data using the program SNULD.

Start of instruction setTo load Super Natural data

  • Specify the following in a batch Naturalsession:

    LOGON SYSSN
    SNLOAD
    .
    FIN

SNDELUF2 - Deleting User Files in Batch

SNDELUF2 replaces SNDELUF and is used to delete user files in batch. SNDELUF2 caters for the extended ranges of FNR and DBID available with NaturalVersion 2.3.

Notes:

  1. SNDELUF is still available for compatability reasons.
  2. When deleting user files in batch, the same JCL is used for the active user as for running transactions in batch mode.
  3. When user files are deleted using RJE, the batch job must have the same input delimiter as the online session (Natural parameter ID).

Start of instruction setTo delete user files in batch

  • Issue the following command in the library SYSSN:

    LOGON SYSSN
    SNDELUF2 parameter1,parameter2,parameter3,parameter4,parameter5
    .
    FIN

    with the parameters described in the following section.

Note:
Parameters must be in delimiter mode (Natural parameter IM=D).

parameter1

DBID-FNR (N10)

Specify the physical Adabas file and database ID (DBID (N5) FNR (N5)) of the Super Natural personal database.

parameter2

User ID (A7)

Specify the ID of the user for whom the files are to be deleted. *END indicates the end of the sequence, *ALL indicates all users.

parameter3

File Name (A20)

Specify which file is to be processed. blank ( ) indicates all files.

parameter4

Status (A3)

Specify which of the processed files are to be deleted. blank ( ) indicates all files marked by the user for deletion and all files with expired retention period. ALL indicates all files.DAT indicates unconditional deletion of all specified data.

parameter5

User File DDM Prefix (A2)

Specify the user file DDM prefix as defined in the options (default UF).

SNSORTFI - Sorting File Links in User Profiles

The utility SNSORTFI should be used in batch mode. It sorts alphabetically the files that are linked to a user profile so that the file list at transaction creation is displayed in alphabetical order.

This utility should be used from time to time when new files are added to a Super Natural environment and are linked with users through the file profile. In this case, the file list of the user is not newly sorted alphabetically. Instead, the file is added to the end of the list.

Note:
When a new file is linked through a user profile, the files of this user are automatically newly sorted.

File links in user profiles are sorted by using the program SNSORTFI in library SYSSN in the form:

LOGON SYSSN
SNSORTFI parameter
FIN

parameter

User ID (A7)

If parameter is blank, file links of all user profiles are sorted. Parameter can be used in any of the following forms:

NAME sorts file links in one specific user profile
NAM* sorts file links in all user profiles starting with NAM
NAM< sorts file links in all user profiles from the beginning until NAM
NAM> sorts file links in all user profiles from NAM until the end