CHAIN Examples


 

The following is an example of the CHAIN utility:

 

CHAIN MYCHAIN -MONDAY,TUESDAY

 

The CMDFILE file (MYCHAIN.CHN) contains the following:

 

1.

//IF MONDAY

2.

&This CHAIN BUILDs the null AAM file MONDAY

3.

&MONDATA.TXT contains an * to terminate the BUILD

4.

BUILD MONDAY.TXT -* < MONDATA.TXT

5.

//*Tap F1 to continue or F2 to terminate

6.

SUNAAMDX MONDAY,,L300à-U,1-12,13-25

7.

//XIF

8.

//IF TUESDAY

9.

&This CHAIN BUILDs the null AAM file TUESDAY

10.

&TUESDATA.TXT contains an * to terminate the BUILD

11.

BUILD TUESDAY.TXT -* < TUESDATA.TXT

12.

//*Tap F1 to continue or F2 to terminate

13.

SUNAAMDX TUESDAY,,L300 -U,1-12,13-25

14.

//XIF

15.

//IF ~MONDAY

16.

// IF ~TUESDAY

17.

//. Invalid option given on command line

18.

//. MONDAY or TUESDAY must be given

19.

//. Try again.

20.

// XIF

21.

//XIF

 

If the tag 'MONDAY' was entered on the command line, line 4 would be executed. The operator would then have the option of terminating the CHAIN by pressing F2 or continuing the CHAIN, processing line 6, by pressing F1. If the tag 'TUESDAY' was entered on the command line, line 11 would be executed. The operator would then have the option of terminating the CHAIN by pressing F2 or continuing the CHAIN, processing line 13, by pressing F1. If neither tag was given, the FALSE (~) condition would be true for both MONDAY and TUESDAY therefore lines 15-21 would be processed resulting in lines 17-19 being displayed. NOTE: Any lines beginning with an ampersand (&) are ignored by the CHAIN and, as in this example, may be used for comment lines.

 

 

See Also: CHAIN, Utilities

 



System Utilities