NCAR/TN-1 78+1A NCAR TECHNICAL NOTE

I a- l iI October 1981

Interactive Computing on the IBM 4341

SCIENTIFIC COMPUTING DIVISION 4 NATIONAL CENTER FOR ATMOSPHERIC RESEARCH BOULDER, COLORADO Interactive Computing on the IBM 4341 Table of Cmtents

UISAPVm 1 THE IBM 4341 COMPUTING SYSTEM ...... 1-1

The Hardware ...... - Virtual Machine Concepts...... - VM/370...... 1-2 Conversational Monitor System (CMS)...... 1-5 Virtual Devices Under CMS ...... 1-6

GETTING STARTED ON THE IBM 4341 ...... 2-1

Understanding CMS ...... 2-1 CMS Virtual Machine ...... 2-1 Communicating with VM/SP ...... 2-2...... 2-2 Getting Commands Into the System...... 2-5 Formatting the Virtual Disks...... 2-9 Profile EXEC...o ...... 2-10 Getting Acquainted with CMS ...... 2-10 Virtual Disks.... 2-14 Other Helpful Information...... 2-18

CYUATPKR 3 THE HELP FACILITY ...... 3-1

Introduction ...... 3-1 Using the HELP Facility...... 3-1 Issuing the HELP Coamand...... 3-2 Menus...... 3-5 Perusing HELP Files...... 3-6 Using the PF Keys...... 3-7 How to Create HELP Files...... 3-10 Formatting the HELP File...... 3-16 Related Publications...... 3-24 CHAPER 4 EDITING ON THE IBM 4341 ...... 4-1

Introduction ...... 4-1 The IBM 4341 Full-Screen Editor ...... 4-3 Using Program Function (PF) Keys ...... 4-8 Scrolling Backward and Forward ...... 4-10 Using PREFIX Subcommands...... 4-12 Moving Through A File ...... 4-17 Making Changes in a File...... 4-18 Ending an Editing Session ...... 4-24 Learning More About the Editor...4-31 The IBM 4341 Line Editor ...... 4-35 Entering Data...... 4-36 Column Pointer...... 4-37 Line Pointer...... 4-38 Making Changes in a File...... 4-41 Ending an Editing Session ...... 4-53 Using Special Characters...... 4-59

CHAPT3R5 IBM 4341 VM/SP CCOMMAND LANGUAGE FACILITY ...... 5-1

EXEC 2...... 5-1 EXEC 2 User Variables ...... 5-2 Variable Assignment Statements ...... 5-4 EXEC 2 Control Statements ...... 5-4 Logic Flow ...... 5-5 Processing Flow ...... 5-7 Interactive Data Passing ...... 5-9 Profile XEDIT ..... 5-11...... NCAR .EXECs...... \\\ \\ \\ 5-11 References ...... - References.5-13 1

6 RUNNING AND DEBUGGING JOBS ON THE IBM 4341 ...... 6-1

Introduction...... 6-1 Files Used and Created by the FORTRAN Process ...... 6-1 Running a Simple FORTRAN Job ...... 6-2 Changing File Characteristics ...... 6-4 More Sophisticated FORTRAN Programming ...... 6-5 Using IFTRAN ...... 6-10 Assembler Language Programming ...... 6-10 Debugging on the IBM 4341... 6-10 FORTVS FORTRAN Warnings ...... 6-13 Error Messages ...... 6-14 How to Submit a Job to the CDC 7600 ...... 6-14 Submitting a Job to the CRAY-1 from the IBM ...... 6-15

Appendix A: IBM Commands Appendix B: tNAR EXECS and Utilities Appendix C: Keyboard Templates CIMPB 1: E 1M 4341 SZSIETPI

The SCD computing system is complex, and it is difficult to disguise that complexity without impairing function. The IBM 4341 system is flexible; it is possible therefore to develop same elegance in the user interface while re- taining full user access to all system features.

Cbnfifquration The IBM 4341 configuration installed at NCAR has a cen- tral memory of 4 megabytes, 3,997 megabytes of disk storage, and 6 magnetic tape drives with 4 at 6250/1600 bpi (200 ips), 1 at 1600/800 bpi (200 ips), and 1 seven- track 556/800 bpi (125 ips) . A card reader (800 cpm) and line-printer (1200 lpm) are also installed.

There are two communications controllers, an IBM 3705 and an IBM Series/l. The 3705 handles bisynchronous communi- cations with remote IBM 3270 series controllers, comput- ers and terminals and asynchronous communications with terminals. The Series/1 is used to interface a variety of local asynchronous ASCII CRT terminals to the system. The Series/I adds some intelligence to the work of these terminals, making them look to the 4341 like IBM 3270 type terminals. Among other things, this enables users to take advantage of the full-screen editing capability of the system editor.

All communications lines, both local and remote, are phy- sically connected to the GANDALF PACX IV. When communi- cation with the IBM system is initiated, either by RJE call up or by the initial interactive log-on message, the GANDALF connects the line to an appropriate port on the 3705 or Series/l. If no such port is available, the re- quest for access is queued and an appropriate message re- turned to the user. Note: After ten minutes of inac- tivity the PACX will automatically disconnect the port.

Texmnals Several varieties of interactive terminals in the NCAR Available Mesa Lab are held available for use by visitors and by NCAR staff without their own terminal. Some of these are located in Room 4A , the Visitor Area.

VIRcUAL MACHIN VEI EPL In all modern machines of capacity greater than the smal- lest of miniccmputers, the operating system facilitates multiprogramming, i.e. the concurrent sharing of system resources among several programs, but with only one pro- gram in control of the central processor (CPU) at one time. The determination of when each of the concurrently active programs gets control of the CPU is a complex pro- cess. However, the process is one which maximizes the productive use of the CPU, and other resources, while minimizing the elapsed wall-clock time for each program

1-1 to run to completion. For obvious reasons, multi- programming is frequently referred to as "time-sharing".

IBatc and Computer programs can be divided into two classes, batch Interactive and interactive. Programs running in batch mode normally Pr ass run from beginning to end without the need for operator intervention, except perhaps for the mounting of tapes and similar activity. Programs running in interactive mode, as the term implies, are often characterized by a high degree of information exchange between the program and the user of the program, via an interactive terminal of some kind. Most modern computers have time sharing operating systems that facilitate concurrent execution of both batch and interactive programs. (Our CRAY-1 is an exception.)

One must be careful not to use the term "time-sharing" when meaning interactive computing. Time-sharing can oc- cur without interactive programs running and vice-versa on small computers!

W/370 IBM's Data Processing Division has implemented multi- programming in its computers in a way that is unique among U.S. hardware manufacturers. In addition to pro- viding a multi-programming operating system, IBM has tak- en the view that, in principle, each program would bene- fit from being run in a separate "computer" which would be configured precisely to the needs of the program. This is an extreme position and physically unrealistic. However, the idea is expressed in the Virtual Machine operating system, VM/370, which was developed for the IBM 370 series of machines in order to faciltate the further development of operating systems. This operating system supervises the operation of a number of "virtual machines". These machines can be batch machines, each with its own input and output queues in "virtual card readers" and "virtual punches or printers" respectively. The various batch machines may operate at different exe- cution priority levels. In addition, a unique "virtual machine" can be created for each interactive user. Each user may have a "virtual configuration" tailored to his particular requirements.

All these virtual machines, of course, must be accommo- dated on the same real computer, and the characteristics of the various virtual machines are restricted by the limitations of that hardware. The concept of virtual storage, in which central memory overlays are handled by the operating system and are invisible to the user, is of course a part of the virtual machine concept. At this point it should be clear that the virtual machines are really sets of interlocking programs.

1-2 %WSP Control The SCD's IBM 4341 is being operated under a heavily Program modified release, Level 6, of VM/370. This has been so extensively revised and overhauled that it is given a new name, VM/SP - Virtual Machine/System Product. VM/SP con- tains several major software products. There is a super- visor, called the Control Program or CP, which supervises and coordinates the operation of the various virtual machines. There is a command language in CP which en- ables the SCD personnel to manage the machine. Some of the CP commands are accessible to the user of a virtual machine to give him access to CP facilities required by his virtual machine. For example, initial log-on in in- teractive mode is to the CP.

CP esour All management of the real resources of the computer is Maiage ent handled by the CP, e.g. disk and tape I/O, memory manage- ment, card reading, line printing, etc. All unit record I/O is spooled (i.e., written to disk, not the real dev- ice). The disk file may then be directed to another vir- tual machine, to a remote location, or to the real device and so output, say from a virtual machine to a line printer, is written to a spool file. Thus "virtual printing" can occur whether or not the real line printer is functioning or available; actual printing of the con- tents of the file takes place when the spool file reaches the top of the real printer queue or, by suitable com- mands, printing can be delayed. Note: One might wish to examine interactively the contents of a spool file to make sure a program ran correctly before printing poten- tially voluminous output! Thus CP has numerous commands for the manipulation of spool files.

CP esource CP maintains records of the resources associated with Rmcords each virtual machine. Therefore a rich vocabulary of commands is provided for inquiring about the status of one's virtual machine and for changing that status.

CP maintains an area of storage called discontiguous saved segments containing a variety of subroutines acces- sible to all the virtual machines. These subsystems are re-entrant (i.e., one copy may be used simultaneously by multiple users), hence features potentially required by all virtual machines are provided efficiently and without substantial demands being made on the virtual storage of the virtual machines. One of these subsystems is the system editor. Another is the command interpreter. Some of the virtual machine operating systems (e.g. CMS) are also there. Figure 1.1 shows a typical organization of the real machine operating under the control program (CP) of VM/SP.

1-3 FIGURE 1.1 Organization of a Real Machine under VM/SP Control Program

Real Machine

CMS C MS CMS BatchBatchMe s User ~User~ell ...... ~ User Un s e #1 r . .n.l #44 MRSCSAccessl Machine i_____t I

Virtual Machines

JS CMSa (Conversational Monitor System) is the operating sys- tem for the virtual interactive machines. For each of the n users indicated, there is a different CMS virtual machine. The four CMS batch machines are virtual machines to which a CMS interactive user can submit a batch job. However, as noted above, most of the special CMS software is re-entrant and each virtual machine has a relatively small operating system storage requirement

1-4 (65K bytes) called the CMS nucleus, plus another 65 K bytes of control blocks (transient program area, free storage, etc.).

K9CS RSCS (Remote Spooling Control System) is the virtual machine that processes jobs submitted by a remote job en- try terminal for onward transmission to the CRAY-1 or CDC 7600 machines.

Ot-hr Mat-bh The network access machine mediates all interaction with the network by all the other virtual machines.

There are many other, usually small, virtual machines dedicated to other tasks. Some of these will be dis- cussed in Section V, Chapter 1.

WM SY2 An interactive user of the IBM 4341 logs on first to the S (OIS)'I2 real machine, operating under CP. The system then creates an interactive virtual machine, operating under CMS, for the user based on information in the user's directory entry. By giving the command:

ipl cms

the desired interactive operating system is loaded and initialized. CMS is the only interactive system sup- ported on the NCAR IBM 4341.

Since the ipl command is included in the user's directory entry the user's CMS machine is ipl'd automatically and the user finds himself in interactive mode with his vir- tual machine immediately after logging on.

Direcory In generating a user's CMS machine, the CP refers to known user parameters such as disk allocation, the number of virtual disk drives - called "minidisks" - specified by the user, whether virtual unit record equipment has been created by the user (virtual card reader, card punch and line printer), and so on.

File ce It is very important to appreciate the extent to which A.:aw these virtual machines are treated by the software as real machines, and as machines whose management is com- pletely in the hands of the user. The minidisks consist of contiguous blocks on real physical disk drives, but for the most part the system manages this space for you. The system allocates the disk by blocks. Consequently, if you have many small files (less than 1024 bytes) you may have unused space. A very large file may be scat- tered all over your disks in non-contiguous space elim- inating unused holes. Much of this scattering may in- crease access time, but the system provides efficient use

1-5 of the disk space. If you find your access time is too great because a very large file is not stored contiguous- ly, you may copy your disk and then reformat the per- manent disk and then re-copy your files back to your per- manent disk.

The CMS user has at his disposal an extensive set of com- mands for communicating both with his own virtual machine and with the real machine operating under the CP. A use- ful selection from both sets of commands is to be found in Appendix A and further discussion of the format and use of these commands is found throughout this User's Guide.

All CMS users have access to the system EDITOR, although users coming in through the IBM 3705 will be unable to use the full screen capabilities due to limitations in the IBM software. All CMS users will have access to a library of utilities (Section VII, Chapter 2 and Appen- dix B in this section) and procedures (called EXECS in IBM jargon) described in Chapter 5. [One utility, of in- terest to owners of vector graphics equipment of the HP 2648A or Tektronix 4010 type or DEC VT100 with retro- graphics boards, permits previewing of graphical output, produced on the CRAY-1 or CDC 7600, before the output is dispatched to the DICCMED for exposure. This is under development at this printing.]

VIMUL UIVII(!2 In addition to the virtual disks, the minidisks, each CMS virtual machine is generated with a certain minimum vir- tual configuration. All of the virtual peripherals have associated with them a hexadecimal device code by which the system addresses the device. The minimal or default configuration is as follows:

Virtual Device Device Code Capacity

Interactive terminal 009 N/A Card reader 00C N/A Card Punch 0OD N/A Line printer OOE N/A Minidisk (R/O) 190 N/A Minidisk (R/W) 191 1/4 - 1 megabyte Minidisk (R/O) 19E N/A Virtual storage N/A 512 K bytes

Card Punch The real machine at NCAR has no card punch. While an in- teractive machine's virtual card reader can be linked to the real card reader, this process is discouraged. The virtual reader and punch, however, are extensively used as the medium of communication between virtual machines. Messages may be sent to the virtual reader another virtu- al machine. The virtual cards "punched" at the sending

1-6 machine may be "read" in the destination machine's virtu- al card reader. For implementation details, see Chapter 6.

Minidiks The minidisks 190, 19E, and 318 are accessible in read mode only. They are shared with other virtual machines and contain systems routines and utilities.

Minidisk 191 is the user s own permanent disk filespace and it can be accessed both for reading and writing. Disk capacity is defined in physical 512 byte blocks. Logical blocks may vary in size but the default block size is 1024 bytes. All NCAR users receive an initial allocation of one megabyte. University users receive one-quarter of a megabyte. This allocation is adequate for the storage of a number of batch job files, or rela- tively small programs.

Additional disk space may be allocated to a user. Appli- cation for additional space should be made in writing to the Director of the SCD, explaining why the additional space is required.

neivy If a user wishes to distribute his permanent disk space allocation over additional virtual disk drives, he can arrange for "delivery" of additional minidisks with dev- ice numbers 192, 193, etc. These additional minidisks should be applied for at the consulting office. These minidisks have to be created by the system management.

Paswods A user may also attach one-to-eight character passwords to any of his own minidisks to control access to them. This can be performed by the user using the READPW,WRITEPW execs. See Appendix B of this section.

Central PlEmry The "central memory" of the virtual machine is initially set to 512 K bytes. This can be increased by using the STORAGE command. For example:

STORAGE 1024K or lM

The maximum amount of virtual storage available to any user is 2 megabytes.

Although each user has a firmly fixed limit on his per- manent disk storage allocation, he is able to access additional storage on a temporary basis. A user may create temporary minidisks, of a capacity to meet a tem- porary need, using the DEFINE command. Thus, if execu- tion of a program requires disk space greater than that available to the user from his permanent file allocation,

1-7 he can still run the program after creating the appropri- ate temporary minidisks. At log-off time these temporary minidisks disappear, so they must not be used for storing permanent files. (See TEMPDISK EXEC, Appendix B).

FIUS

J16. -nts As the term implies, a file is a body of information stored on some medium. The file is composed of groups of data elements called records. If the file is a data file, then the records will usually comprise different sets of values for the group of variables referred to above as data elements. If the file is a source program file, the record comprises a single data element - a FOR- TRAN statement, assembly level instruction, etc.

The fundamental components of a file then are: the file, the record, and the data element.

Blocks Depending on the storage medium, another structure comes on the scene. This is the block. A block is an integral number of records and is the smallest unit of information that can be moved to or from the storage medium. To some extent, the size of the block is under installation con- trol. For example, blocks on the IBM 3370 disk drives are physically 512 bytes in length. If a file should have a fixed record length of 32 bytes, then the block would contain 16 records. The number of records in a block is called the blocking factor - 16 in this example. (On the minidisks, however, CMS deals with "logical" blocks consisting primarily of 1024 bytes.)

When transferring files between different media, care must be taken to ensure that appropriate blocking is pro- vided for in the commands. For example, a blocking fac- tor of 16, for 64 byte records, is appropriate on mini- disks; it is highly inefficient on magnetic tape where a larger factor would be preferred.

File INjt Files may be of any length that the medium can accommo- date. Records similarly may be of any length, though in CMS a maximum record length of 32760 bytes is enforced. The record length may be fixed, in which case all records are of uniform length. Record lengths may also be vari- able.

I/ID Ocerb~ad While records are transferred in blocks, the user often wishes to access only one record, or perhaps only one data element in one record. Regardless, the machine resources expended are those required to access the en- tire block. In designing programs, it is very important to bear in mind the block structure of data transfers in order to optimize the input/output process by minimizing

1-8 the number of blocks transferred. In general, sequential accessing of records results in relatively low I/O over- heads; random accessing of data elements or of records results in relatively high I/O overheads.

Pertonent oar Files may be permanent files in which case they occupy T-emprary Files part of the user s permanent file resources. Files may be temporary files in which case they are defined during a job or interactive session and do not survive termina- tion of that job or session. Furthermore, temporary files are not usually considered as occupying part of the user's permanent file resources.

FIIS IN CMH In all computer systems, files are identified at least by a name. The system maintains a file directory where this name is stored, together with the physical address at which the beginning of the file is located and such other information as the particular system requires.

In CMS three quantities are required to define fully a file. These are the filename (fn), filetype (ft), and filemode (fm). These three quantities define the fileid.

Fflweams In CMS, filenames consist of one-to-eight characters. The characters permitted are the alphabetic characters A-Z, and the ten digits 0-9. You may start the filename with a number if you wish.

Filetyps The filetype is a string of one-to-eight alphameric char- acters as in the filename. Some filetypes are reserved by the system. Since some CMS ccmmands will operate only on files of the appropriate type, it is important to know these reserved types and to use them where appropriate. Otherwise the filetype can be regarded as an extension to the filename. If you fail to specify a filetype, you will receive a message so indicating.

Table 1.2 gives sanome of the filetypes with special mean- ings for use by CMS.

1-9 Table 1.2 Filetypes Used by CMS Commands

FILETYPE COMMAND COMMENTS

FORTRAN FORTRAN FORTRAN source file FORTVS FREE.ORT** EFORTGI **Free format FORTRAN source file

FTnnOOl FORTHX Refers to I/O unit #nn in FORTRAN program

ASSEMBLE ASSEMBLE Contains source statements for assembler language programs.

AUXxxxx UPDATE Points to files that contain UPDATE control statements for multiple updates.

CNTRL UPDATE Lists files that either contain UPDATE control statements or point to additional files.

COPY MACLIB Can contain COPY control statements and macros or copy files to be added to MACLIBs.

EXEC EXEC Can contain sequences of CMS or user-written LISTFILE commands, with execution control statements.

HELPCMS HELP Contains descriptive information for CP and HELPCP CMS commands, messages, EXEC2 statements, HELPDEBU CMS Editor and System Product Editor sub- HELPEDIT commands, and menu lists. HELPMENU HLPMSG HELPEXC2 HELPHELP HELPXEDI HELPSET HELPPREF

LISTING ASSEMBLE Listings are produced by the assembler and FORTVS the language processors. PLIOPT

MACLIB GLOBAL Library members contain definitions or MACLIB copy files; the MACLIB command creates the library, and lists, adds, deletes, or replaces members. The GLOBAL commnand identifies which macro libraries should be searched during an assembly or compilation. ** NOT AVAILABLE AT NCAR

1-10 Table 1.2 (Con't)

MACRO MACLIB Contains macro definitions to be added to a CMS macro library (MACLIB).

MAP INCLUDE Maps created by the LOAD and INCLUDE commands LOAD indicate entry point locations; the MACLIB, MACLIB TXTLIB, and TAPE commands produce MAP files. TAPE TXTLIB

MODULE GENMOD MDDULE files created by the GENMOD command are LOADMDD nonrelocatable executable programs. These MODMAP can be executed as new CMS commands. The LOADMOD command loads a MODULE file for execution; the MODMAP command displays a map of entry point locations.

SYNONYM SYNONYM Contains a table of synonyms for CMS commands and user-written EXEC and MODULE files.

TEXT ASSEMBLE TEXT files contain relocatable object code INCLUDE created by the assembler and compilers. The LOAD LOAD and INCLUDE ccxmands load them into TXTLIB storage for execution. The TXTLIB command TESTFORT manipulates libraries of TEXT files.

TXTLIB GLOBAL Library members contain relocatable object TXTLIB code. The TXTLIB command creates the library, and lists or deletes existing members. The GLOBAL command identifies TXTLIBs to search.

UPDATE UPDATE Contains UPDATE control statements for single updates applied to source programs.

UPDLOG UPDATE Contains a record of additions, deletions, or changes made with UPDATE command.

UPDTxxxx UPDATE Contains UPDATE control statements for multilevel updates.

Filenode The filemode is a two character string of which the first is alphabetic (A-Z) and the second numeric (0-5).

The alphabetic character designates to CMS the minidisk on which the file resides (this is independent of the CP device address). Minidisk 191 is normally designated the A disk. The system minidisks 190 and 19E have filemode letters S and Y, respectively. When other minidisks are created, either permanent or temporary, a different

1-11 filemode letter must be specified.

Filea§de Digit The filemode digit defines the type of access permitted to users other than the creator of the file. It is also used by the creator of the file to designate a particular family of files that can then be manipulated as a group by appropriate commands. The meanings of the filemode digits are as follows:

0: A filemode digit of 0 makes the file PRIVATE and prevents users, other than the file creator, from reading that file even though these users may have been given read access to the minidisk. This level of security, however, is not too high. There are other ways to get to the file once read access to the minidisk is given.

1: This is the GENERAL DEFAULT filemode digit and has no particular significance.

2: Used to designate a FAMILY OF FILES.

3: Files with filemode digit three are ERASED after they are read!! This filemode digit should be used with great care. If used with a file with filetype EXEC the result is unpredictable. It should be used in programs which create files that are needed only once; in this case it eliminates the need to erase the file to prevent it occupying permanent file space unnecessarily.

4: Designates IBM OS simulated DATA SET format.

5: Used in the same way as 2 to designate a FAMILY OF FILES.

Mnipulation of Files may be created only under program control. The Files creation of a program source file, or the manual entry of a data file, is done under the control of the system EDI- TOR (Chapter 4). The EDITOR will require the user to specify a filename and filetype. The user may also specify a filemode; if no filemode is specified, the XEDIT-editor will define it as Al.

If the file is intended to be used as an output file from a user program, it must first be referenced using the FILEDEF command, (Chapter 5).

Commands are discussed in Chapter 5. Examples for common manipulations of files are: listing (TYPE, PRINT), sort- ing (SORT), renaming (RENAME), copying (COPYFILE), eras- ing or purging (ERASE), compare (COMPARE), etc. Atten-

1-12 tion is directed to Appendix A for a summary of these commands.

Use of * and = All file manipulation cocmands refer to the fileid. Re- placement of any of the three fields in the fileid by an * means: carry out the command on all files identified by the remaining fields, regardless of the content of the field replaced by the asterisk. For example, the com- mand:

LISTFILE * FORTRAN A wIll listIall FORTRAN source code files on the A disk

will list all FORTRAN source code files on the A disk (191) with filemode digit 1. Similarly, the command,

LISTFILE * FORTRAN *

will list all FORTRAN source code files on all the user"s minidisks, regardless of filemode digit.

Some file manipulation commands refer to two or more fileid's. In two of these, RENAME and COPYFILE, an = sign can be used in conjunction with the * to ensure the specified fields will be left unchanged. For example,

COPYFILE * * A = = B

will copy all files on the user's A disk on to his B disk.

Padxjai Provision is made in CMS (see COPYFILE in Chapter 5) to Uqwkirx Films pack files and to unpack them. Packing is a process which eliminates redundant information from the file, such as the leading and trailing blanks in FORTRAN state- ments. Unpacking restores the information and ensures that the records are formatted correctly. On the aver- age, packed files occupy about one-third of the space of unpacked files. Therefore,if you are running short of minidisk space, you can make more efficient use of your disk allocation by storing only packed files.

Note: Packing and unpacking is a CPU intensive process. Unnecessary packing should be avoided. You should organ- ize your work, wherever possible, to unpack only those files to be used in a given session, and to pack at the end of the session only those unpacked files that are to be stored on the permanent minidisks. There is no point

1-13 to packing files that are stored on temporary disks!!

DISK PE3bS9SE3S Interactive use of a computer system implies that each FILE SPMa user has available a certain amount of permanent file maxrxw space on the system s magnetic disc units--DASD, Direct Access Storage Device in IBM terminology.

It must be emphasized that all users will have access to a much larger common pool of temporary file space. Any files created in temporary file space disappear from the system at logoff.

If the allocation of permanent file space is inadequate for the needs of a particular user, additional permanent file space can be made available on application to the SCD Director. The application, which can be a simple letter, should list the reasons why your allocation is inadequate and indicate for what period of time the sup- plementary allocation is likely to be required.

1-14 -C-iB~R 2: IG SI"fED on(GNt GsJE BM 4341

E9B In Chapter 1 you were introduced to CP, the VM/SP Control Program, and CMS, the Conversational Mbnitor System run- ning as the interactive operating system on the SCD's IBM 4341.

CMS (Conversational Monitor System) has been designed to make computing tasks easier, but if you are unfamiliar with CMS, then the tasks may seem more difficult. The information contained in this guide is designed to help you become familiar with CMS.

A series of commands may be set up in an "executable" file. These are called EXECS and may replace keying in the same information over and over again. The existing execs and the execs you create become a part of your CMS command language. They are in themselves CMS commands.

Almost every CMS command that you enter results in some kind of activity with a Direct Access Storage Device (DASD), known in CMS simply as a disk, or minidisk. Data and programs are stored on disks in what are called "files" (described in Chapter 1).

Chapter 4 introduces you to XEDIT the CMS editor. It contains all the basic information you need to create and write a disk file directly from your terminal, or to correct or modify an existing CMS file.

Just as important as the CMS editor is the CMS facility called the EXEC 2 processor or interpreter. Using EXEC files, you can execute many commands and programs by entering a single command line from your terminal or you can write your cwn CMS commands. Chapter 5 presents a survey of the basic characteristics and functions of EXEC 2.

QOS V1RfL A virtual machine is the functional equivalent of a real MWIMNRE computer that you control from your terminal, using a command language of active verbs and nouns. The system on the SCDIs IBM 4341 that enables you to control your "virtual machine" is the Virtual Machine/System Product (VM/SP).

The command languages of this system correspond to the two components, CP (Control Program) and CMS (Conversa- tional Mbnitor System). CP controls the resources of the real machine; that is, the physical computer in the machine room. It also manages the communications among virtual machines, and between a virtual machine and the real system. CMS is the interactive operating system

2-1 designed specifically to run under CP.

O(MODI U WILGf W hen you are running your virtual machine under VM/SP, WVBSSP each command, or request for work, that you enter on your terminal is processed as it is entered; usually, you enter one coxnand at a time and commands are processed in the order that you enter them.

You can enter CP commands from either the CP or CMS en- vironment, but you cannot enter CMS commands while in the CP environment. Thus most of your work will be done in the CMS environment. There are times, however, when you may inadvertently end up in the CP environment, so it is important to know how to get back to CMS. You may get to CP from CMS by typing in "cp" and you may get to CMS from CP by typing in "begin".

After you have typed or keyed in the line you wish to enter, you press the "return" key on the keyboard. When you press this key, the line you have entered is passed to the commnand environment you want to have process it. If you press this key without entering any data, you have entered a "null line." Null lines sometimes have special meanings in VM/SP.

If you make a mistake entering a command line, VM/SP tells you what your mistake was, and you must enter the line again. The examples in this guide assume that the command lines are correctly entered.

You can enter commands using any combination of uppercase and lowercase characters; WM/SP translates your input to uppercase. Note: Examples in this chapter show all user-entered input lines in lowercase characters and sys- tem responses in uppercase characters.

CP a The control program (CP) component of VM/SP has its own Language command language. Much like any other language, the CP command language has a set of rules and structures.

There are two types of CP commands: system conmands and user-defined commands. There are also various classes of users on the system. You, as a class G or general user, may issue CP system oommands to control the operating system running in your virtual machine much like an operator controls the entire VM/SP operating system using keys and switches on the system console. User-defined CP commands are allowed, too; however a systems programmer must create them for you.

2-2 CP CtA VM/SP command consists of a command name, usually fol- Structure lowed by one or more positional operands. The general form of the CP command line is:

CNAME [operand [operand..]]

where CNAME is the command name. You must use one or more blanks to separate each entry in the command line unless otherwise indicated. The command operands are keywords and positional operands of no more than eight alphameric characters each.

If, for example, you are receiving printed output at your terminal and do not want to be interrupted by messages from other users, you can enter the following:

set msg off

to refuse messages, since it is CP that handles communi- cation among virtual machines. In this example "set" is the command name and "msg" and "off" are both operands.

The CSI CQin The CMS command language allows you to create, modify and Laguage debug problems or application programs and to manipulate data files.

When you invoke the XEDIT command, you are placed in the XEDIT mode. In this mode you are allowed to create and modify files. The CMS EXEC 2 interpreter provides execu- tion procedures consisting of CP and CMS commands; they also provide the conditional execution capability of a macro language. The DEBUG command gives you several pro- gram debugging subcommands. This facility is described in Chapter 6 of this guide.

Other CMS commands allow you to read cards from a virtual card reader, punch cards to a virtual card punch, and print records on a virtual printer. Many commands are provided to help you manipulate your virtual disks and files.

The HELP command (described in chapter 3 of this guide) you can use to display at your terminal information on how to use CP commands and CMS commands, subcommands, and EXECs, and explanations of CP and CMS messages. You can issue the HELP command when a brief explanation of syn- tax, a parameter, or function is sufficient, thereby avoiding interrupting your terminal session to refer to a manual.

Since you can invoke CP commands from within the CMS vir- tual machine environment, the CP and CMS command languages are, for practical purposes, a single, in-

2-3 tegrated command language for CMS users.

OCS ad cat A CMS command is similar in format to the CP commands. That is, it consists of a command name, usually followed by one or more positional operands, but in many cases the CMS command includes an option list.

CNAME [operands... [(options..[)]]

where CNAME is the command name. You must use one or more blanks to separate each entry in the command line unless otherwise indicated.

The C(aaxn Ne The command name (CNAME) is an alphameric symbol of one to eight characters. The names are based on verbs that describe the function you want the system to perform. For example, you may want to find out information con- cerning your CMS files. In this case, you would use the LISTFILE command. To use the LISTFILE command enter:

listfile fn ft fm

where listfile is the command name, fn, ft and fm are the filename, filetype and filemode, respectively. If you wanted to list all the files with the file name FORTEST regardless of type or mode, you would enter:

listfile fortest * *

The asterisk specifies "all".

C4and Ojperands The command operands are keywords and/or positional operands of one to eight alphameric characters each. The operands specify the information on which the system operates when it performs the command function.

You must write the operands in the order in which they appear in the command formats unless otherwise specified. When you are using CMS, blanks may optionally be used to separate the last operand from the option list. CMS recognizes a left parenthesis "(" as the beginning of an option list; it does not have to be preceded by a blank. To list your files with the date when they were written you would use the listfile command with the "date" op- tion. To list all your FORTRAN files with the date that they were written you would enter:

listfile * fortran *(date

This would give you a list of all your FORTRAN files on all your disks and print the date that they were written.

2-4 4~~Y~H Before you can use CP and CMS, you should know (1) how to operate your terminal and (2) your userid (user identifi- cation) and password.

If you are accessing the IBM 4341 through the Gandalf PACX and through the Series/I or 11/34 you will have full screen editing capabilites. If your access is through the 3705 via dial-up connection you may be using the equivalent of a TTY terminal and have only line editing capabilities. The logon procedure looks quite different depending on which mode of access you have available.

1LLAqTl~~nal There are many types of terminals you can use as a VM/SP virtual console. Before you can conveniently use any of the commands and facilities described in this guide, you have to familiarize yourself with the terminal you are using and know which access mode you are going to be us- ing.

In this guide, examples and usage notes assume that you are using an ASCII screen terminal ( such as a Perkin El- mer Fox or an ADM 3a+). Examples will be given of both full screen mode and line mode for some procedures. See Appendix C for terminal keyboard templates.

evxicl am To aid you in entering command or data lines from your t~i~nj Sybs terminal a set of logical line editing symbols is provid- ed which you can use to correct mistakes as you enter lines. Each symbol has been assigned a default character value.

The logical line editing symbols are defined for each virtual machine during VM/SP system generation. If your terminal's keyboard lacks any of these special charac- ters, other special characters for logical line editing may be defined for you. You can find out what logical line editing symbols are in effect for your virtual machine by entering the following CP command:

query terminal

The response might be something like:

LINEND #, LINEDEL , CHARDEL @, ESCAPE ", TABCHAR ON LINESIZE 080, TEXT OFF, APL OFF, ATIN ON, MDDE 4M HILIGHT COFFT, CONMODE 3215, BREAKIN IED, BRKKEY PA1, SCRNSAVE OFF

Yoxr Userid a Your userid is a symbol that identifies your virtual Pamswd machine to VM/SP and allows you to gain access to the system. Your password is a symbol that functions as a protective device ensuring that only those allowed can use your virtual machine. The userid and password are

2-5 installed in the system directory by a system programmer. Appendix B, Section I "An Overview of NCAR's Computing Environment" includes a copy of the form to be filled out by you before you may begin.

To provide yourself with additional security on the sys- Passwrd tem you may want to change your password from time to time. To do this, enter:

password

The system will prompt you for your new password and then ask you to enter your old password for validation.

Using the~ PA)X The PACX (Private Automatic Computer exchange) is the frxm NCAR Gandalf Data Inc's model of port selection device that T hm na S NCAR has purchased as an interface between a user s ter- minal and the various computers. Follow the instructions below to use this device.

First, get the PACX's attention. This is accomplished on Fox terminals by pressing the "LINE" key so it releases from the locked down position. This breaks any present connection. Then press "LINE" again so it returns to the locked down or on-line position. On ADM3A+ terminals press and hold the "HERE IS" key, then let go. The PACX should now realize you want its attention. See Chapter 2 of "An Overview of NCAR's Computing Environment" for de- tails on Data Communication.

Give the PACX a second to set itself up, then press the "RETURN" key. The PACX should respond with the message, "ENTER CLASS". Type in the desired class number accord- ing to the following table:

Series 1 Simulator (11/34) 130 Series 1 120 3705 110

If all is well you should get the message "CLASS XXX START" where XXX is an echo of the number you have just entered. Note that on most terminals you will not see the numbers you are typing as you type them. This is normal and not a malfunction. If the computer you are connecting to does not immediately give you a prompt, try prompting it with the "REITURN" button.

2-6 If you did not get the message "CLASS XXX START" you should have received one of the following messages:

"CLASS XXX UNASSIGNED" The number you typed is not a ENTER CLASS valid class number. Try again.

"CLASS XXX UNAVAILABLE" The computer you want to access ENTER CLASS is down. Try again later, or try another class number.

"CLASS XXX RESTRICTED" Access to that class is restricted. ENTER CLASS Select a different class.

"CLASS XXX BUSY" All ports of that class are busy, {or "CLASS XXX BLOCKED"} but you may queue up in position QUEUE SIZE NNNN NNN for the next freed port by DO YOU WISH TO QUEUE? responding "y" or "yes". "n" you do not wish to queue.

In all cases you have twenty seconds to make your next keystroke, or the PACX will drop your connection and say "BYE". If this happens, you must start over and regain the PACX's attention. After three unsuccessful attempts to connect, the PACX will drop your connection and say "BYE". At any time entering "q" will cause the PACX to drop connection and say "BYE".

Using te X If you are at a remote site, you will be entering the fog Re ote Sites PACX through telephone lines. Once you hear the con- necting signal, depress the carriage return key on your terminal. This signals the PACX that you are ready to initiate a terminal session. The PACX will echo with the "ENTER CLASS" prompt described above. Enter the ap- propriate class as indicated above and proceed with your terminal session.

Log~-n throzgh the Logon will begin once the system logo is displayed, 3705 "VM/370 ONLINE". To begin, you should depress the return key to gain the system prompt which is a "." (period). Next, you should type "logon ssss..." where "ssss..." is your logon id previously entered into the system directo- ry. When asked for your password, enter your password. Once this has been done (and you press the return key again), the system will display the results of the PRO- FILE EXEC execution and will terminate its display by typing the system prompt. At this point you are logged on and may begin your session. A typical logon is shown below:

2-7 VM/370 ONLINE: ! [this is the system result of the return] .logon smith ENTER PASSWORD: smith DASD 190 LINKED R/O; R/W BY MAINT; R/O BY 037 USERS DASD 19E LINKED R/O; R/W BY MAINT; R/O BY 036 USERS FILES: 001 RDR, NOPRT, NOPUN LOGON AT 9:51:34 MDT WEDNESDAY 06/06/81 NCAR/CMS 04/22/81 8101 . Y (19E) R/O A(191) R/O DASD 318 LINKED R/O; R/W BY MAINT; R/O BY 019 USERS C(318) R/0 R; T=0.01/0.01 12:36:10

All commands executed by the system will terminate with a line beginning with "R". If an error condition is gen- erated by the command, its severity level will follow the "R" inside of parentheses. An error return code 8 would look like "R(00008)". An R;; indicates no errors or a return code of 0, all larger numbers indicate errors. "T=...". The T= gives timing information about the com- mand and the remainder of the line is the wall clock time.

If you had failed to hit the return key to gain the sys- tem prompt, the "1" would have ended up on the line which shows the "!" and the following 2 lines would have shown up as "ogon SMITH" and "RESTART" respectively. The logon ccmuand would then have to be re-typed.

Lg- thru the Logging on through the Series 1 is not significantly dif- PNX ail Series 1 ferent from logging on through the 3705 except the "." prompt is missing. A typical log-on through the PACX and through the Series I looks something like the following:

2-8 ENTER CLASS 120 YALE ASCII TERMINAL COMMUNICATIONS SYSTEM ENTER TEINAL TYPE: VALID TYPES ARE: PE1100 IBM3103 VT100 AD1M3A (user enter terminal type fran list) VM/370

# ## # # ##### ####### ### # # ## ## X # # # # # # # ##### # # # # # ## # # # ##### # # # # # # # # # # # # ## # # # # # # # # # # ## ##### ####

RUNNING

logon smith ENTER PASSWORD XXDCxDCOXX (user enter password)

From here the logon looks much the same as through the 3705. The information printed is the same, the prompt is missing and in the lower right hand corner of the screen you will note that it prints VM READ, RUNNING, MORE, CP READ. Depending on the terminal you are using the means of scrolling and refreshing the screen may vary. See Appendix C of this guide for information on the different terminal key boards and how to use the function keys.

PRU ~ I W~ The two virtual disks VIRIIWL DI- assigned to each user may now be formatted. NotE: Formatting virtual disks is a one-time operation, doing it on subsequent logons will destroyany files resident on your virtual disks. An NCAR EXEC has been written to FORMAT your disks for you. This EXEC is called IAMNEW. To format your disks enter:

iamnew

This exec will also copy a default PROFILE EXEC to your A-disk. Now your disks are formatted. Note: The "iam- new" command issues a "query" for you and prints out your disks and labels. To check on the status of your disks

2-9 at any time; the disks accessed by you and the percentage of space in use enter:

query disk

An exec is a file which is executable in CMS. An exec must have a filetype of EXEC. One exec is executed at the time of logon with no special action taken on your part. This special exec is the profile exec and it should reside on your A disk, thus its full name is:

PROFILE EXEC A

A default profile exec was executed and moved to your A- disk for you when you logged on as a new user and exe- cuted IAMNEW. As you become more familiar with the sys- tem there will be commands you will want to add to or delete from the profile exec.

This is a copy of the default PROFILE EXEC. You may modify it to suit yourself with XEDIT (see Chapter 4 of this guide).

&TRACE OFF EXE)C TIYPROF EXEC LINKLIB CP LINK MAINT 318 318 RR ACCESS 318 h GLOBAL MACLIB DMSSP CMSLIB OSMACRD OSMACRO1 TSOMAC ACCESS 192 b

The &TRACE OFF statement causes the statements in the exec not to be printed before they are executed.

PM~ w1~o At this point you have logged on, your disks are format- ted and a profile exec was executed at logon. Your own profile exec will automatically be executed the next time you logon. At this time you could "logoff" and then "lo- gon" again. To logoff you enter:

logoff

You have used the commands; LOGOFF, LOGON. They are all CP conmminands. EXEC, GLOBAL and XEDIT are CMS commands. You may want to try a few more CMS commands. To see what is on your A disk enter:

query disk a

The response looks something like:

2-10 LABEL CUU M STAT CYL TYPE BLKSIZE FILES BLKS USED-% BLKS LEFT ELK IOTAL Al 191 A R/W FB 3370 1024 1 1-0 982 1000

The response tells you that you have an A-disk at virtual address 191; it also provides information such as how much rooman there is on the disk and how much of it is used.

Your A-disk is the disk you use most often in CMS, to contain your CMS files. Files are collections of data and may have many purposes. As of now your A disk should have only your profile exec on it. The following exer- cise will use the editor to create another file on your A-disk.

For this exercise, the data is meaningless. To use the editor, enter:

mynew file

You should receive the response:

NEW FILE: XEDIT:

which indicates that this file does not already exist on your A-disk. Enter:

input

Your should receive the response:

INPUT MODE:

and you can start to create the file, that is, write input records that are eventually going to be written onto your A-disk. Enter 5 or 6 data lines, such as:

this is a test file to see if I can use this xedit editor.

Now, enter a null line ( hit the return key again). You should receive the message:

XEDIT:

Enter:

file

You should see the message:

2-11 R; T=0.01/0.05 19:31:12

You have just written a CMS file onto your A-disk. If you enter the CMS command:

type mynew file a

you should see the following:

THIS IS A TEST FILE TO SEE IF I CAN USE THIS XEDIT EDITOR.

The CMS camand, TYPE requested a display of the disk file MYNEW FILE on your A-disk.

The exercise above is repeated here using the full screen display. Enter:

xedit mynew file

You should receive the response:

MYNEW FILE Al F80 TRUNC=80 SIZE=0 LINE=0 COLUMN=l ====* * TOP OF FILE * * * |...+....1...+....2...+....3...... 4..+....5 ....+....6....+ =====* * * END OF FILE * * *

X E D I T 1 FILE

which indicates that this file does not alrady exist on your A-disk and is ready to be edited. Note the lower case "input" command in the next example.

2-12 MYNEW FILE Al F80 TRUNC=80 SIZE=0 LINE=0 COLUMN=l

-=== * * * TOP OF FILE * * * -....+.... .1..+...3....2+....4.... +3. +....5****5* * *+....6O....+.... ===== * * * END OF FILE * * *

===>input

X E D I T 1 FILE

MYNEW FILE Al F80 TRUNC=80 SIZE=0 LINE=0 OOLUMN=l

===== * * * TOP OF FILE * * * *... * ....1 ...... 2...... 3*....+* .4... +...5*.....+....6....+.. ===== * * * END OF FILE * * *

===> * * * INPUT ZCNE * * *

I N P U T-M O D E 1 FILE

which indicates that this file is ready to be edited. Now if you type in the three lines they will appear on the screen between the TOP OF FILE and the END OF FILE as shown in the next box.

2-13 * * * TOP OF FILE * * * TH====IS IS A TEST FILE .==== TO SEE IF I CAN USE THIS XEDIT EDITOR

=* * * END OF FILE * * *

-==> this xedit editor

I N P U T-M 0 D E 1 FILE

Now hit again and you will be back in XEDIT. Then type in "file" and the session will be saved in your new file. For additional information, please see chapter 4, of this User's Guide.

To list the names of all the files on your A-disk type the CMS command

1 * * a

To erase the file MYNEW, enter:

erase mynew file

Now, if you re-issue the TYPE conmmand, you should receive the messsage:

FILE NOT FOUND

If you re-issue the l(istfile) command, the file MYNEW should not appear in the list.

VIRTMuL DIS

P r u x n i t a Permanent virtual disks are defined jrlt-- I I Di s ksm in your directory. They can be your own personal disks which you may or may not wish to have other users access; or, they may be com- mon disks, owned by one user, but generally shared in read-only mode by any user on the system. Such a disk is the system maintained disk 318 which contains VS FORTRAN and IFTRAN. Virtual disks, defined in your directory, are made available to you when you log on to the system.

2-14 They must be accessed in order to use them (usually in your PROFILE EXEC).

TLExicary Virtual If during a terminal session you require additional disk Disks space, you can define a temporary minidisk via the NCAR exec "TEMPDISK". The TEMPDISK command gets a temporary disk of up to 20000 blocks and formats it. The virtual address assigned to the temporary disk will be the first available address at 500 or above, and the mode will be the first mode available to your terminal. The format of the TEMPDISK command is: TEMPDISK SIZE where SIZE is the number of blocks for the temporary disk, not to exceed 20000. To use the command enter:

tempdisk 15000

the response looks like:

DASD 500 DEFINED 15000 BLK TEMPDISK ACCESSED AS D R; T=...... where the .... represents the time that would normally be printed there.

If you should enter:

query search

you would find the temporary disk was defined as:

TEMP 500 D R/W

When you have no further need for temporary disk space, you can release the space by issuing the command:

rel d (det

and the response will look like:

DASD 500 DETACHED R; T= ......

Sharing Virtual To gain temporary access to someone else's permanent vir- Disks tual disk during your terminal session, you must know the userid of the disk's owner, as well as its virtual ad- dress in the cwner's system. If the owner is controlling the access to the disk, you have to obtain the read or write password. The NCAR exec "LINKTO" enables you to do this. Default values have been set up for all but the userid. To link to another user's A disk enter the fol- lowing:

linkto userid

2-15 The link will be made to the other user's A disk and the mode will be the first available mode in your virtual system and the address will be the first available address above 120 in your system.

Atxssing Your The local ccmmands "LINKTO" and "TEMPDISK" use the CP Virtual Disks commands LINK and DEFINE repectively. They tell CP to add DASD devices to your virtual machine configuration. CMS must also know about these disks. "LINKTO" uses the ACCESS command to establish a filemode letter for the linked disk. For example:

access 192 b

would identify virtual disk 192 as your minidisk B. TEMPDISK uses the FORMAT coamand, since it is a brand new disk, to establish a filemode letter. CMS uses filemode letters to manage your files during a terminal session. By using the ACCESS command you can control:

R Whether you can write on a disk or only read from it (its read/write status)

R The library search order for programs executing in your virtual machine.

Q Which disks are to contain the new files that you create. If you want to know which disks you currently have access to, issue the conmand:

query search

You might see the following:

AAA 191 A R/W BBB 192 B R/W CMS 318 C R/O TEMP500 D R/W

The first column indicates the label on the disk (assigned when the disk is formatted), and the second column shows the virtual address assigned to it. The third column contains the filemode letter. All letters of the alphabet are valid filemode letters. The forth column indicates the read/write status of the disk. In the example all the disks are read/write status except 318 which is a read only disk. It is standard to use your 191(A) disk as your primary disk.

2-16 Reeasing Virtual When you no longer need a disk during a terminal session, Disks or if you want to assign a currently active filemode letter to another disk, use the CMS command RELEASE:

release c

Then, you can issue the ACCESS command to assign the filemode letter c to another disk.

When you no longer need disks in your virtual machine configuration, use the CP command DETACH to disconnect them from your virtual machine:

detach 194 detach 291

If you are going to release and detach the disk at the same time, you can use the DET option of the RELEASE com- mand:

release 194 (det

Camging Disk Your disks are initially set up for you with read/write APass Mrd passwords. To find out what your current passwords are PassBrd you may enter:

dirm mdpw

The system will prompt you for your CP or logon password to validate the command. After you give your password and you disk passwords will be displayed. The following example shows a typical display of disk pass- words.

DVHDMF301I MINIDISK 191: READ=READ WRITE=WR MULTI=MM DVHDMF301I MINIDISK 192: READ=READ WRITE=WR MULTI=Mv CMS

Now that you see what your access passwords are you may change them using the DIRM MDISK command. This command will ask for the address of the minidisk whose access you want to change. It will then prompt you and at the same time provide you with adequate information to change your passwords. To find out how to change your passwords and/or to change your password enter:

dirm mdisk

2-17 Libraries Before compiling even the most simple FORTRAN program, the appropriate libraries to be searched by the LOAD statement must be identified. The "cp link... "and "ac- cess 318 h" commands shown in the PROFILE EXEC are all necessary in order to compile, load and execute a FORTRAN program on the 4341. In order to access the necessary libraries you must link to and access the 318 system disk. The global statements in the compiler execs iden- tify the libraries of interest. More details on these libraries are found in chapter 2 of Compilers and Software Libraries

When you give a command to compile a FORTRAN program, the name of the file must be of a specific nature. The filename may be 1-8 alphanumerics (special characters are not permitted nor are embedded blanks) the first of which must be alphabetic, the filetype must be FORTRAN, and the filemode is the disk on which the file resides. The com- mands to compile and load a program do not allow you to specify the filetype or filemode. Because of this res- triction, there is a default search order which is alpha- betical (i.e., A, then B, then C etc). The way your disks were defined, you have an A and perhaps a D disk. Because of the standard search order, it would be prefer- able to have your disks be the A and B disks. In your PROFILE EXEC the "access" of the 192 disk with designa- tion 'b' rather than 'd accomplished this. This access gives your two virtual disks the 1st and 2nd positions in the search sequence. The real value in this is that, should you wish to link to the files of another user, the linked disk will not be automatically searched before your own. Hence, you cannot mistakenly compile and exe- cute another user's program because the names happen to be the same.

The logoff command is simply "logoff" after which the system types some timing information and then displays the line "VM/370 ONLINE". If you are in the middle of a session and need to logoff for a short time, but you do not want to start all over, simply replace "logoff" with Special Cliarax"Iers "disconnect". When ready to resume, logon as before and all temporary disks and tapes will still be available. NBWIM log anyone else off, use the "disconnect" command.

Certain characters have a special meaning to CMS. The double quote (") is the escape character and the pound sign (#) is the logical line end. To enter these charac- ters as text, each must be preceded by the escape charac- ter. For example to get a double quote in a message, you would have to type two double quotes (""); to get a pound sign, type double quote, pound sign ("#). (In input mode in XEDIT, you needn t preceed the character with ").

2-18 Intrnt rn If you want to interrupt a terminal that is typing (i.e. displaying output), you should depress the return key. This will interrupt the typing, and the screen may be viewed at leisure. To resume, hit the return key. If the intent is to terminate the typing, you must type "ht" or "hx" before hitting the return key. The "ht" (halt typing) is used if one is merely listing a file; if the printout is the result of an execution process, then "hx" (halt execution) is needed.

s File A news file exists on the IBM 4341 which will contain up-to-date news items concerning the 4341. To read the latest version of this file, type "vmnews". Be prepared to interrupt the typing when the screen fills, as this is not done automatically. To interrupt the typing, type 'ht' (halt typing) and depress the return key.

iaecs A number of execs have been produced by SCD staff to make it easier to get started. These include execs to simpli- fy tape mounting and file movement, packing and unpacking of files for space preservation, IFTRAN and FORTRAN com- pilation, loading and execution as well as many other commonly used functions. Please refer to Appendix B for a listing of current NCAR execs and to Chapter 5 for an introduction to the Command Language Facility, EXEC 2.

An extensive help facility exists on the IBM 4341. To get information on most commands and execs, type "help name". See Chapter 3 for detailed information on the help facility.

2-19 CEOWYRE 3: THEIP FAC3f r

On-line documentation of components of the IBM system is available through the CMS HELP facility. The information displayed is the same as that given in the various IBM VM/SP publications. More information about the HELP fa- cility is available in the IBM VM/SP CMS user's guide. Also, on-line information for the HELP command can be displayed by issuing the CMS command:

HELP HELP

IE HFLP The HELP facility uses the System Product Editor to 0 sIIDo 7 display HELP files. The HELP facility is designed to be used by 3270-type video terminals in full-screen mode. It can also be used by line-mode or teletype terminals. However, in this case the capabilities afforded through the PF (Program Function) keys (explained later in the section) are not available and HELP facility commands must be entered explicitly. Some of the procedures described below assume the use of full screen capabili- ties.

HELP displays the message text, explanation, system ac- tion and user action for messages. For commands, HELP will display the description, format, and parameters, or optionally any of these. HELP displays the format and description for EXEC statements.

HELP allows you to issue CP or CMS commands directly from the displayed HELP file if you are in full-screen mode. Thus, you may issue a command on the "command line" while viewing the HELP file for that command. The specified command will remain in the command line until you press ENTER (or RETURN), even if you scroll the screen. This feature assists you in remembering what you must specify and how you must specify it.

HELP files are grouped into catagories or "components". The "menu" for each component (except messages) lists the HELP files for that component. A particular HELP file is displayed by specifying the component and file name. The HELP facility consists of eight components:

1. CP Comiands

2. CMS Commands

3. CP and CMS Messages

4. EDIT Subcommands

3-1 5. XEDIT Subcommands

6. DEBUG Subccmmands

7. EXEC Statements

8. EXEC 2 Statements

Each of these components (except CP and CMS messages) has a menu that lists all the HELP files available for that component. You may call a HELP file directly or you may call a menu and then select the HELP file from the menu.

LsE HvP To use the HELP facility, you issue the CMS HELP command. The format of the HELP command is:

HELP Message MENU Help component MENU component {name {(option [) ] }} CMS

where:

HELP Specify HELP HELP if you want information about using the CMS HELP facility. The sys- tem will display the HELP file for the CMS HELP command. This explains how to call HELP menus or files.

No Argument If you specify HELP with no arguments, the system will display a list of the component menus available. You may then display any of these menus by specifying

HELP component MENU

and then display the HELP file for any cmrmmand listed therein directly from the MENU display.

Message is the seven-character message ID you specify to display the HELP file for a mes- sage. You must specify the message ID in the form 'xxxnnnt', where:

3-2 xxx indicates the component (for example, DMS for CMS messages, DMK for CP messages).

nnn is the message number.

t is the message type.

Note that you must specify the seven- character message ID, not the ten-character ID that also identifies the issuing module. For example, specify DMS250S rather than DMSHLP250S for information on that message.

MENU Displays the menu of HELP files availble for the CMS component. It is equivalent to issuing HELP CMS MENU.

Component The name of the component you want informa- tion about. The help facility has the fol- lowing components:

Component Description of Contents Name

CMS Conversational Monitor System commands CP Control Program commands DEBUG CMS DEBUG subcommands EDIT CMS EDIT text processor subcommands EXEC CMS EXEC statements EXEC2 EXEC 2 statements XEDIT XEDIT subcommands

The default component for commands is CMS; if you want to display a HELP file for a CMS command, you need only specify HELP name.

name The name of the command or statement whose HELP file you want displayed. This name is analagous to a CMS file name. There are commands whose name is a special character. Since the characters themselves are illegal as CMS filenames, the HELP facility recog- nizes special-character filenames and translates them to appropriate CMS file names. They are:

3-3 ?- translates to file name QUESMARK - translates to file name EQUAL / - translates to file name SLASH " translates to file name DBLQUOTE & - translates to file name AMPRSAND * - translates to file name ASTERISK - translates to file name PERIOD

Option is valid only for CMS and CP commands and subcommands. You may specify DESC, FORM, PARM, or ALL. ALL is the default. The HELP command options are:

ALL Display the specified HELP file starting at the beginning.

DESC Display the specified HELP file starting with the description.

FORM Display the specified HELP file starting with the format specifications.

PARM Display the specified HELP file starting with the parameter descriptions.

When a HELP command option is specified, the entire HELP file is made available to the user. The options effect only the initial position of the HELP file display.

The following are examples of HELP calls issued as CMS coamands. Remember that you may also call HELP files directly from menus or from the XEDIT command. To request a HELP file for CP message DMK006I, you issue:

HELP DMK006I

To request a menu of CP commands, you issue:

HELP CP MENU

To request a HELP file for the XEDIT LOCATE subcommand, you issue:

HELP XEDIT LOCATE

To request display of the HELP file for the CMS TAPE com- mand beginning with the description part, you issue:

3-4 HELP CMS TAPE (DESC

or

HELP TAPE (DESC

Menus are alphabetical lists of all HELP files for a com- ponent. On terminals having both upper and lower case capability, menus show the minimum abbreviation of a file name you can issue in upper case characters with the remainder of the name in lower case characters (for exam- ple, ACcess). You can get a list of all the menus avail- able to you by issuing:

HELP

You get a menu by issuing:

HELP component MENU.

See Figure 3.1 for an example of a displayed menu.

You can request display of a particular HELP file directly from a menu by positioning the cursor at any part of the name and pressing the PF1 key (or the equivalent set of key strokes specified for your terminal if you do not have PF keys). After the HELP file is displayed, you may return the menu by pressing PF1 again. (See Appendix C for the configuration of PF keys for your terminal).

You can position the cursor at the file name you want by using the cursor keys on your terminal, or by using the TAB key (PF4) provided by HELP; the LOCATE facility can also be used by typing the name desired and pressing PF5. When the cursor is positioned at the file name you want, press the PF1 key to display the HELP file for that name.

If a name in a displayed menu file is preceded by an asterisk (*), this indicates that the named file is itself a menu file.

3-5 line 1 ======> CMS MENU <=====> .HELP INFORMATION <=--== line 2 =-->- /* line 3 A file may be selected for viewing by placing the cursor under any character of the file name wanted and pressing the PF1 key. A MENU file is indicated when a name is preceded by an asterisk (*).

*DEBUG DDR FILedef Listfile RELease SYNonym *Edit DEBUG FORMAT LISTIC Rename TAPE *EXec DISK GENDIRT LOAD RO TAPEMAC *EXEC2 DLBL Genmod LOADMod RSFRV TAPPDS *Xedit DOSLIB GLobal MACLib RT TXTlib ACcess DOSLKED HB MDDmap RUN Type AMserv DSERV Help MDVEfile SET Update Assemble Edit HO CPTION SO Xedit ASSGN ERASE HT PRint SORT CMSBATCH ESERV HX PSERV SSERV C4OMpare EXec INclude PUnch START COPYfile EXEC2 IAbeldef Query STATE CP FETch LISTDS READcard SVCtrace

line x PF1=HELP PF2=TOP PF3=QUIT PF7=UP PF8=DOWN PF9=PF Keys line y PF4=TAB PF5=LOCATE PF6=PREV CMD PF10=UP1/2 PFll1=DOWNl/2 PF12=CANCEL

I .. Figure 3.1 CMS Menu

/* For terminals which have cursor position indicated as a character posi- tion rather than an underline, the cursor should be positioned on any charac- ter of the name and not under any character.

iFWE3insP The System Product Editor is a full-screen CMS text edi- tor. The HELP facility uses this editor to display HELP files. Many of the features of XEDIT subcommands are available for use on the displayed files. Two of the available features are:

Locate - Locate a specified character string in the file

Scrolling - Move the display up or down

See the publication VM/SP System Product Editor Command and Macro Reference for complete explanations of these features.

Not all features of the System Product Editor are avail- able for use on the displayed help files. The excluded features are: ADD, COMMAND, CURSOR, FILE, INPUT, MACRO, MODIFY, MSG, READ, REPLACE, SAVE, SET, SOS, and STACK. These are excluded to prevent unnecessary copying of HELP

3-6 files and to avoid any inadvertent changes to the help files.

While these features will not work on files displayed by the HELP facility, all the System Product Editor features are available if you wish to use the XEDIT subcommand to edit the files (calling file by XEDIT filename filetype, not through HELP).

When you issue an XEDIT subcommand to reposition the display of the file on the screen, HELP ensures that a full screen of data is displayed (if there is one). This is done to eliminate blank, or nearly blank, screens.

USIG THE W K The PF keys have the following meanings when using the HELP facility (for non-IBM 327X type terminals, the equivalent key stroke (s) for PF function keys for sup- ported terminals may be found in Appendix C).

PF1 (HELP) is used to access HELP files from a menu after the cursor is positioned at the name of the desired file.

(MENU) is used to return to a menu from a displayed HELP file. (See Figure 3.2.)

PF2 (TOP) moves the display to the top (front) of the HELP file.

PF3 (QUIT) returns to the previous file displayed. (See Figure 3.2.)

PF4 (TAB) is used to tab through a menu. Pressing PF4 while a menu is displayed causes the cursor to move to the first character of the next file name.

(PRINT) is used with HELP files other than menus. PF4 gives a hardcopy capability. Pressing PF4 while the HELP file is displayed causes a copy of the current screen to be sent to the currently spooled printer.

PF5 (LOCATE) is used with the XEDIT subcommand LOCATE on HELP files. You enter the string to be searched for on the command line. Then press PF5 to tell HELP to LOCATE the first occurrence of the string, starting with the current line. If you press PF5 again, HELP will LOCATE the next occurrence of the string, and so on. HELP highlights the line located.

3-7 For detailed information about how to use the LO- CATE subcommand, see the description in the pub- lication, VM/SP System Product Editor Command and Macro Reference.

PF6 (PREV.CMD.) retrieves the last user command is- sued from the command input area.

PF7 (UP) moves the display towards the top of file one screen. If your screen is 24 lines, the display is moved up 20 lines.

PF8 (NEXT) moves the display towards the bottom of file one screen. If your screen is 24 lines, the display is moved down 20 lines.

PF9 (PF Key) displays a file containing explanation of PF key meanings for displayed files.

PF10 (UP1/2) moves the display towards the top of file one-half a screen. If your screen is 24 lines, the display is moved up 10 lines.

PFll (NEXT1/2) moves the display towards the bottom of file one-half a screen. If your screen is 24 lines, the display is moved down 10 lines.

PF12 (CANCEL) exits from displayed HELP file. PF12 will quit all HELP files currently in storage. For example, if you called a menu, then called a HELP file from that menu, PF12 will quit both the file and the menu and return control to the ori- ginating environment. (See Figure 3.2.)

3-8 YOUR Step 1: XEDIT a file. Then you FILE want HELP for XEDIT subcommands.

XEDIT Step 2: Specify 'HELP XEDIT MENU' Menu to get the XEDIT Menu displayed.

SET Step 3: Select the *SET file from the Menu XEDIT menu and the SET Menu is displayed.

1st sub- Step 4: Select a subcommand file from command the SET Menu and the file is displayed.

2nd sub- Step 5: You specify "HELP XEDIT name" to command display the file of another subcommand.

Assume you have followed the sequence given above and the HELP file for the 2nd subcommand is being displayed.

If you were to press:

PF1 - you would return to the last Menu file displayed (in this case step 3).

PF3 - you would return to the previous file displayed (in this case step 4).

PF12 - you would quit all HELP files called and return to your pre-HELP location (in this case step 1).

I Figure 3.2 Example of Using PF1, PF3, and PF12.

3-9 E-DW-- TO CREWE EMP The remainder of this chapter is relevant only to the user creating his own HELP files. The beginning user is encouraged to skip this material.

Users can create their own personal HELP files to be used in conjunction with the HELP facility. For example, HELP files describing the use of personal commands can be created along with the "menu" containing a list of these names. The HELP facility can then be used to easily display the menu of available HELP files, or the contents of a particular HELP file. Creating The HELP facility makes use of naming conventions for filenames and filetypes to identify files which are to be used. A list of reserved filetypes for HELP is given in Figure 3.3.

------HELPCP for CP commands HELPCMS for CMS commands HELPDEBU for DEBUG subcommands HELPEDIT for EDIT subcommands HELPEXEC for EXEC statements HELPEXC2 for EXEC 2 statements HELPHELP HELP files for HELP HELPMENU for menus of HELP components HELPMSG for CMS and CP messages HELPXEDI for XEDIT subcommands HELPSET for XEDIT SET subcommands HELPPREF for XEDIT PREFIX subcommands

------

Figure 3.3 Reserved Filetypes for HELP Facility

Menus for the HELP facility have the filetype HELPMENU. The filename is the component name they serve (for exam- ple, EXEC HELPMENU is the filename filetype for the EXEC menu). Menus contain a list of the HELP files for a com- ponent. There are only a few restrictions you must fol- low when creating menu files. You may precede the list of names with any amount of information for the user. Between this information and the list of names, you must include two lines with the following HELP format words (see Figure 3.8 for a complete list of HELP formatting commands available):

.sp 2 .fo off

Following these commands, you enter the filenames in any order, but they must begin in column 1 of the file and be

3-10 one to a line. When creating a menu file in this format the HELP facility will sort the filenames alphabetically and oolumnize them based on the physical screen width characteristics, when the Menu is called. Figure 3.4 illustrates an example of a menu file.

.CM (The .CM format word can be used to include comments) .CM This is an example of a user generated "menu". UTILS .CM HELPMENU are the filename and filetype respectively. .CM .CM .CM .CM .IN 5 Menu items for UTILITIES .IN -5 .SP 2 .FO CFF RUNJOB GETTMP DELF

Figure 3.4. Contents of menu file UTILS HELPMENU

If the menu in Figure 3.4 were created and the command "HELP UTILS MENU" were issued, the following would be displayed.

MENU ITEMS FOR UTILITIES

DELF GETITMP RUNJOB

Figure 3.5. Output display of "HELP UTILS MENU"

Creating U~m HELP files have the filetype HELPxxxx where xxxx identi- fies the associated component. The first 4 characters of the component name as specified in the filename of the corresponding MENU are used. Examples of HELP filenames and filetypes are:

3-11 filename filetype comment

ACCESS HELPCMS CMS ACCESS command description

LINK HELPP CP LINK command description

DELF HELPUTIL Description of DELF command indicated in menu UTILS.

Users creating their own personal HELP files for the HELP facility can format their own file or use the format words the HELP facility supports for formatting displayed information. These format words do the following:

I Draw boxes to enclose tables, illustrations or text

Q Place comments within a file

® Indicate that certain input lines are to be included in the formatted output only under certain condi- tions

W Cause concatenation of input lines and left- and right-justification of output

Q Indent only the next input line the specified number of spaces

@ Indent a series of input lines the specified number of spaces

I Indent the specified number of spaces all but the first line in a series of input lines

Q Insert blank lines between output lines

* Change the final output representation of any input character

Figure 3.6 gives an example of a HELP file for the DELF command listed in the menu of the UTILS component.

3-12 .CM .CM HELP FILE FOR DELF C(MMAND .BX 10 79 .IN 9 .OF 13 DELPF COAND TO DELETE FILES AFTER ACKNOWLEDGEMVENT. IF FILENUDE IS NOT SPECIFIED, 'AA IS ASSUMED. IF THE RFEQUESTED FILE IS FOUND, THE NAME IS DISPLAYED AND VERIFICATION OF DELETION IS REQUESTED. .SP .BX 10 19 79 .OF -11 USAGE DELF FILENAME FILETYPE {FILEMODE} A .BX OFF

Figure 3.6. HELP file for the DELF EXEC.

3-13 Figure 3.7 shows the information displayed on the screen when the following command is issued:

HELP UTILS DELF

------

DELF OMIAND ITO DELETE FILES AFTER ACKNWLEDGUE . IF FILEMODE IS NOT SPECIFIED, A IS ASSUMED. IF THE REQUESTED FILE IS FOUND, THE NAME IS DISPLAYED AND VERIFICATION OF DELETION IS REQUESTED.

------I------USAGE DELF FILENAME FILETYPE {FILEM)DE} A

I------_. -…_ _ _ ------I

Figure 3.7. Output Display of HELP UTILS DELF

The HELP format words are summarized in Figure 3.8. Descriptions and examples of their use follow.

3-14 Figure 3.8. HELP Format Word Summary

------. ------Format Word Operand Format Function Break Default Value

.BX (BOX) Vl V2...Vn Draws horizontal and Yes Draws a OFF vertical lines around horizontal subsequent output text, line. in blank columns.

.CM Comments Places comments in a file No (COMMENT) for future reference.

.CS n ON/OFF Allows conditional No (CONDI- inclusion of input in TIONAL the formatted output. SECTION)

.FO ON/OFF Causes concatenation of Yes On (FORMAT input lines, and left and MODE) right justification of output.

.IL (IN- nl+nl-n Indents only the next Yes 0 DENT line the specified LINES) number of spaces.

.IN nl+nl-n Specifies the number Yes 0 (INDENT) of spaces subsequent text is to be indented.

.OF nI+nl-n Provides a technique Yes 0 (OFFSET) for indenting all but the first line of a section.

.SP n Specifies the number of Yes 1 (SPACE) blank lines to be insert- ed before the next output line.

.TR s t Specifies the final out- No (TRANS- put representation of any LATE) input character.

______

3-15 Ftasatting tthe A limited number of formatting capabilities are available HMP File for user generated HELP files. The most important are explained below.

Enclosing Text The HELP facility can insert vertical and horizontal (.BX Format Word) lines in the formatted output to enclose text, illustra- tions, or tables. You use the .BX format word to specify when you want the horizontal lines to appear and in which columns the vertical lines should appear.

The .BX format word is used in three steps to completely enclose text:

1. The first time you issue the .BX format word, speci- fy the columns in which you want the vertical lines to appear. For example:

.bx 1 10 20 30

results in the following output:

Note that this first occurrence of the .BX format word causes a horizontal line to appear between the first and last column you specified.

2. After the first issuance of .BX, begin entering the text that is to be enclosed. As HELP formats these lines, vertical lines are placed in the columns that you specified on .BX. However, if a column already has a data character in it, it is not overlaid with the vertical line. Note that whenever you want just a horizontal line to appear (for example, to separate lines in a table), enter the .BX format work without operands. For example:

.bx

results in the following output:

3. When you have finished entering the text that is to be enclosed, issue:

.bx off

to cause another horizontal line to appear and to prevent any more vertical lines from appearing.

3-16 This output is:

I … ---..I …-...... I…- - - I

The following example illustrates this technique of enclosing text.

.fo off .bx 1 10 50 .in 2 .of 8 Item 1 Put Iteml text here. The second line can be written here. .bx .of 8 Item 2 Then put Item2 text here. .bx off

When these input lines are processed, the result is:

Iteml Put Iteml text here. The second line can be written here. Item2 Then put Item2 text here. ______

This example shows how you can change the vertical struc- ture several times in succession. The control words:

.bx 10 40 .sp .bx 5 45 .sp .bx 10 40 .sp .bx off

result in:

______- - - - - ___ I

, _ _- -__ _ -_ _ _ -_ _ _ _-_ _- - _-_ _- _ _ __-_-_ _ _ __-- - _-,-

IP------I

I. ______I

3-17 Placing Comments In addition to text and format words, HELP files can con- in HELP Files (.CM tain conments. Comments are useful for: Format Word) @ Tracking files. You can include comments that give your name, the date and reason you created a file, and a future date at which the file may be erased.

Documenting formats. If you use a special format in a HELP file that may be accessed by other people, you may want to place notes within the file explain- ing how to update the file.

s Place-holders. If a file is incomplete, you may want to put conments in the file where information should be added later. You can place comments in a HELP file with the .CM format word:

.cm Created 12/21/75 .cm Updated 3/3/76

HELP ignores all .CM format words when processing. Conditional You can indicate to HELP that certain sections of the Display of Text file are to be displayed as output only if the appropri- (.CS Format Word) ate HELP command options are specified. These options are PARM, FORM, DESC, and ALL. (See VM/SP CMS Command and Macro Reference for information on the use of these options.)

In order for HELP command processing to display the ap- propriate information, you must use the .CS format word in the following manner:

.cs 1 on (text for DESC option) .cs 1 off .cs 2 on (text for FORM option) .cs 2 off .cs 3 on (text for PARM option) .cs 3 off

Use of Format Mode Format-mode processing means that the HELP facility (.FO Format Word) displays the output lines without breaks, unless specifi- cally requested, and right-justified. You may not want this type of formatting in all cases; you may want cer- tain output to appear exactly as it appears in the HELP file. For this, use the .FO format word to turn off format-mode processing as follows:

.fo off

3-18 When you want to resume format-mode processing, enter:

.fo on

Format-mode processing is the default.

Indenting Text When you are creating documents, you may want to set off (.IN Format Wbrd) paragraphs or portions of text by indenting them. This often improves the readability by emphasizing certain text. You can cause paragraphs to be indented using the .IN format word. For example, the lines: This line is not indented. .in 5 This line is indented. result in:

This line is not indented. This line is indented. The .IN format word causes a break so that text accumu- lated before the .IN format word is processed and displayed, then the next text is processed.

The .IN format word effectively sets a new left margin for output text so that when you want text indented you do not have to enter blanks in front of the input lines (as you would for normal typing). HELP continues to con- catenate and justify input text lines that begin to column 1, but displays the output indented the number of spaces you specify. Here's another example: These few lines of text are formatted with enough words .in 5 so that you can see how HELP's formatting process .in +3 continues and may .in -6 even be reversed, by using a negative value. These lines may result in:

3-19 These few lines of text are formatted with enough words so that you can see how HELP's formatting process continues and may even be reversed, by using a negative value.

In this example, the first .IN format word shifts output to the right five spaces so that text begins in column 6. The second .IN format word requests that the current indentation increase by three spaces so the left margin is now in column 9. When you supply a negative value with the .IN format word, the margin is shifted to the left.

To cancel an indentation that is in effect, you can use a negative value, or you can use the format word:

.in 0

Because 0 is the default value, you need not specify it when you want to restore the left margin to column 1. You can specify simply:

*in

When you want to indent only a single line of text (that is, the next output line), use the .IL format word. For example:

This line begins in column 1. .in 5 This line begins in column 6, which is now the left margin. .il -3 This line is shifted 3 spaces to the left of the current margin. .il 3 This line is shifted 3 spaces to the right of the current margin.

HELP processes these lines as follows:

3-20 This line begins in column 1. This line begins in column 6, which is now the left margin. This line is shifted 3 spaces to the left of the current margin. This line is shifted 3 spaces to the right of the current margin.

Because the .IL format word causes a break in text, you may find it useful to indicate the beginning of a new paragraph. For example:

.il 3 This line begins a paragraph. .il 3 This line begins another.

These lines result in:

This line begins a paragraph. This line begins another.

Use of Offsets In HELP formatting, an offset differs from an indentation (.OF Format Word) in that offsets do not affect the first line immediately following the format word; the second and subsequent in- put lines are indented the specified number of charac- ters. This is useful, for example, when formatting num- bered lists where text is blocked to the right of the number.

When a .OF format word is processed, the next text line is printed at the current left margin and subsequent lines (until the next .OF or .IN format word) are offset the specified number of characters. For example, the lines:

3-21 .of 5 ----- This line begins a 5-character offset. .of 5 ---- This is another line offset 5 characters. .in 5 An indent changes the left margin and cancels the offset. .of 3 ---This paragraph begins at the new left margin. .of 3 ---Here's one more line.

result in:

-----This line begins a 5-character offset. -----This is another line offset 5 characters. An indent changes the left margin and cancels the offset. ---This paragraph begins at the new left margin. ---Here's one more line.

An offset can be canceled with the format word:

.of 0

This format word causes a break; subsequent text is printed at the current left margin, that is, whatever the indention is (0, if no .IN format word is in effect).

Any INDENT format word cancels a current offset and resets the left margin. If you specify a positive or negative increment with the INDENT format word and an offset is in effect, the offset is canceled and the new left margin is computed from the current indent value.

The .IL (INDENT-LINE) format word uses the current margin (the indent value plus the offset value) when computing the margin for the next line.

To achieve a format that has several levels of offset- ting, you can combine the .IN and .OF format words.

When you use blank space following the item indicator (for example, the number in a numbered list), HELP may

3-22 add extra blanks when it justifies the line; if so, the first line may not be aligned with the remainder of the offset item.

Spacing Between If you do not want an input line to be concatenated with Lines of Text (.SP the line above it, you must cause a break. To cause a Format Word) break in a HELP file, begin a line with one or more blank characters (by using the space bar on your terminal key- board). When HELP reads an input line that begins with a blank character, the formatting process is interrupted; all of the text that has accumulated for the current line is displayed as is, even if more words would have fit on the line; the next input line begins a new output line.

To create paragraphs in text, then, all you have to do is to enter spaces at the beginning of each line that is to begin a new paragraph. For example, the input lines:

This is all part of the first sentence. But the second line begins a new paragraph since it begins with a blank.

may be displayed by HELP as:

This is all part of the first sentence. But the second line begins a new paragraph since it begins with a blank.

If you want to place blank lines between lines of text, you can press the space bar at least once on a line that has no other text, then press the Return or Enter key.

Instead of entering a blank line, you can use the .SP format word. Thus the input lines:

This is line 1. .sp This is line 2.

are formatted as follows by HELP:

This is line 1. < …--1 blank line This is line 2.

The .SP format word allows you to enter a numeric parame- ter indicating how many spaces you want to leave on the text output. For example:

3-23 .sp 5

indicates that you want to leave five lines of space in the text output. You can use multiple spaces when you want a heading or a title to stand out, for example the lines:

This is line 1. .sp 3 This is line 2 (after 3 blank lines).

will result in:

This is line 1.

This is line 2 (after 3 blank lines).

Translating Output After HELP has formatted an output line but before it Characters (.TR displays that line, HELP may translate any of the charac- Format Word) ters in that line to a different character representa- tion. You use the .TR format word to request that this translation be done. For example, to request that all blanks (x'40') in the file be displayed as question marks, enter:

.tr 40 ?

To stop the translation of the question mark as a blank, enter:

.tr ? ?

Note that when the .TR format word is used without operands, the translation of all characters is stopped.

For a list of related IBM publications, please refer to I 7 11:131F - - - Section I, Appendix C of this User's Guide.

3-24 CETR 4 1:I ON I 4341

Since the SCD IBM 4341 utilizes VM/CMS, an interactive operating system, it provides for the first time an in- teractive editing environment to users of the Scientific Computing Division. Users can now store programs, parts of programs, and even mod decks online in files rather than in boxes of punched cards. Such files can be creat- ed and modified interactively using the editor in one of two modes--full-screen editing or line editing.

FuU-Smeen The advent of CRT-based screen terminals and higher com- Editi!a munication speeds has given rise to a different approach to editing, referred to as screen (or full-screen) edit- ing. The most striking difference for the user is the way in which position is specified in the file being edited. With an entire screenful of text displayed, a "cursor" is used to point to a specific line and column in the file. On most terminals, the cursor is identified as a reverse video character, that is, the character is dark on a light background while the other characters are light on dark. Editing commands are available for posi- tioning the cursor on the screen and for changing the portion of the file displayed on the screen.

Line Eitig The IBM editor can also be utilized as a line editor. Most interactive line editors are designed around the as- sumption that you are sitting at a mechanical printing terminal, such as an IBM typewriter terminal or a Tele- typewriter device, connected to the computer via a slow cormunications line (typically 300 baud, 37 characters per second.) Since printing is relatively slow with this equipment, you would want to print only the the necessary parts of the file on the terminal. Consequently, many of the editing commands serve to identify the place in the file where the modifications are to take place; editor commands are used to define the "current line" and "current column" in the file. A separate editor command is given to print the current line on the terminal. Hav- ing thus established your position, you can issue com- mands that modify the file at that point. For example, you might "insert" some lines at that point, "change" a character string in the current line, "replace" the current line with one or more lines, "copy" or "move" the current line to another point in the file or "delete" the current line and perhaps some of those around it.

XaJl on the SOD The SCD IBM 4341 editor is called XEDIT. XEDIT is capa- 1M 4341 ble of functioning both as a line editor and as a screen editor, although not all SCD users will be able to use the screen editing facilities. Since the screen editing functions of XEDIT were specifically designed for use

4-1 with IBM terminals, you can only make use of them with an IBM terminal or with a substantial minicomputer and the necessary software between the 4341 and the terminals. The minicomputer performs the appropriate conversions for translating signals meant for IBM terminals into codes that some other terminal can understand and vice versa.

Within SCD, this means that users who can access the 4341 via the IBM Series One minicomputer will have a choice of full-screen mode or line editing mode. Users coming in through the 3705 will have only the line editing capabil- ities. From past experience, most users who are faced with such a choice eventually end up using the screen ed- itor, although there are definite advantages to being fluent in both forms of editing. For example, it is con- venient to be able to go back to the line editor when a slow communications line (perhaps a 300 baud modem on a phone line) makes it frustrating to wait for the screen editor to refresh the screen. Another cammon use of the line editing function is to put repeated sequences of commands into an editor command file that can be called up to perform the same operations on different files. For example, one might have a series of editing commands that make the long lines of printed output from a CRAY-1 run legibly on a screen terminal, so that one can con- veniently read one s output from a terminal. This edit- ing can be done automatically if the line editing com- mands are put into a file that can be executed every time a printout comes back from the CRAY-1.

As a general rule, it is wise for everyone to learn the line editing commands. These commands can be used with either screen or typewriter terminals, with any communi- cations line (whether or not it goes through the Series One), and in EXEC files that perform sequences of editing operations automatically (at this printing, some NCAR EX- ECs execute only with full-screen capabilities). On the other hand, users who access the 4341 from an IBM screen terminal or through the Series One with some other type of screen terminal should also learn the screen editing functions of XEDIT.

Users who do not have access to the Series One or to IBM screen terminals can use only the line editing facilities of XEDIT. Another mincomruter, a PDP 11/34, is being programmed to perform the conversion functions of the Series One and will eventually provide another avenue to interactive screen editing on the 4341.

4-2 a~I The rest of this chapter is a slightly modified version of chapters 1 and 3 of the IBM document IBM VM/SP: Sys- tem Product Editor User's Guide. It is strictly a tu- torial introduction to the editing facilities that are available to all SCD 4341 users, and is by no means an exhaustive description of the editing capabilities of XEDIT. Anyone who will be doing extensive editing on the 4341 is encouraged to get copies of both the User's Guide mentioned above and of the IBM VM/SP: System Product Ed- itor Ccmmand and Macro Reference.

TME nB 4341 Fnon SCEM EDHTQR

XH~~ITQinxx~~~- After you log on to VM/SP and enter the CMS environment, you are ready to begin creating a file. The editor is invoked with the following CMS command:

XEDIT filename filetype

In the following example, the editor was invoked with the ccmmand:

xedit driver fortran

Before we see how to enter data in the file, let's look at the screen layout:

DRIVER FORTRAN Al F 80 TRUNC=72 SIZE=0 LINE=0 COLUMN=l

=---- * * * TOP OF FILE * * * · ·-+.... 1....+....2....+....3....+....4....+....5...... » .»«6.... +> ==----- * * * END OF FILE * * *

XEDIT 1 FILE

4-3 * File Identification Line The first line on the screen identifies the file being edited. The following information is displayed:

a. filename, filetype, filemode (DRIVER FORTRAN Al) If you do not specify a filemode, the editor assigns a filemode of "Al", which means that the file is to become part of a file collection called your "A-disk".

b. record format and record length (F 80) The record format and record length shown in the example mean that in this file, the length of a line can vary and the file will hold lines up to 80 characters long. A file line can be longer than a screen line.

c. truncation column (TRUNC=72) Any data that is entered beyond 72 characters (in total) is truncated.

d. current number of lines in the file (SIZE=0) Since we have not yet entered data in the file, the number of lines is zero.

e. file line number of the current line (LINE=0)

f. position of the column pointer (COLUMN=l)

* Message Line The editor communicates with you by displaying mes- sages on the second line of the screen. These mes- sages tell you if you have made an error, or they provide information. In the example, this line is blank.

* Cammand Line The large arrow (===>) at the bottom of the screen points to the command input area. One of the ways you communicate with the editor is by entering XEDIT subcommands on this line. Subcommands can be typed in either uppercase or lowercase, or a combination of both, and many can be abbreviated. For example, "INPUT", "Input", and "i" are all valid ways to type the INPUT subcommand.

After typing a subcommand on the command line, you must press the ENTER key to execute the subcommand. (To move the cursor from any place on the screen to the command line, just press the ENTER key.)

4-4 * Status Area The lower right corner (XEDIT 1 FILE) displays the current status of your editing session, for example, edit mode or input mode, and the number of files you are editing. The status area in the example shows that one file is being edited.

* Prefix Area The prefix area is the five left-most columns on the screen and displays five equal signs (=====). Each line in the file has a prefix area associated with it.

You can perform various editing tasks, like deleting a line, by entering one-character commands, called "prefix subcommands", in the prefix area of any line.

* File Area The empty portion of the screen is available to display the file, once editing has begun.

* The Current Line The current line is the file line in the middle of the screen just above the scale.

In the example, the current line is the "TOP OF FILE" line; at this point, the file contains no data.

The current line is an important concept, because most subccmmands perform their functions starting with the current line. Naturally, the line that is current changes during an editing session as you scroll the screen, move up and down, and so forth.

* Scale The scale appears under the current line to assist you in editing. It's like the margin scale on a typewriter.

The vertical bar (|) that appears in column one on the scale is the column pointer. Various subcom- mands perform their functions within a line starting at the column pointer, which you can move to dif- ferent positions on the scale by using XEDIT subcom- mands that will be discussed later. The column under which the column pointer is positioned is called the current column.

4-5 Eatering Data After you enter the XEDIT command, you are in edit mode. You must be in edit mode to enter XEDIT subcommands.

You can enter data into the file using input mode or power typing mode, which are discussed next.

PUTSubcand To enter input mode, type the following subcommand in the command line and press the ENTER key:

===> INPUT

You can then type in your data. The FORTRAN filetype allows you to type data in either upper or lower case and have it entered into the file in upper case.

The next example shows the same file, DRIVER FORTRAN, that is shown in the first example. However, the INPUT subcommand has been entered and the lines of data (each followed by a carriage return) have been typed on the screen. Notice how the screen changes in input mode: the prefix areas (=====) disappear; the message line and status area tell you that you are in input mode; the com- mand line contains the phrase "INPUT ZONE", which marks the end of the input zone and reminds you that you cannot enter subcommands in input mode.

If you have no more data to type, pressing the carriage return twice takes you out of input mode and back into edit mode.

During an editing session, you can enter input mode at any time to insert new lines of data in the file. As you have seen, after the INPUT subcommand is entered, the editor makes room for you to type new lines of data after the current line. In this example, since the file was new and the INPUT subcommand was the first subcommand entered, the TOP OF FILE line was the current line. Later, you will see how to make any line current, so that you can insert lines in input mode between any two exist- ing lines in the file.

4-6 DRIVER FORTRAN Al F 80 TRUNC=72 SIZE=21 LINE=9 COLUMN=l DMSXMD573I INPUT MODE:

* * * TOP OF FILE * * * C C DRIVER PROGRAM FOR SOLVING SYSTEM C GCOMON /BIGBLK/ XLIN(25), AMTRX(32,25), BLIN(32) C CALL INITRD CALL SOLVE (32,25,AMTRX,XLIN,BLIN) CALL ENDPR (25,XLIN) END .1...... 1...... 2... + ..... 43....+45 o ....+...... 6.... +>

===> * * * INPUT ZONE * * * INPUT-MODE 1 FILE

VECOER Sdhxa-ian] The easiest way to enter a large amount of text, like one long paragraph, is by using "power typing". To use power typing, enter the following subcommnand:

===> POWER

The advantage of using power typing is that you can enter data as if the screen were one long line. You do not have to be concerned with line length or word length--you can start typing a word on one line of the screen and finish it on the next. In fact, if you're a skilled typ- ist, you don't even have to look at the screen. When you reach the end of a line, the editor automatically "wraps around" to the beginning of the next line. You can type continuously until the screen is filled.

If you fill up a screen and want to continue typing in power typing mode, press the ENTER key once. The last line you typed is displayed at the top of the screen; the rest of the screen is blank and you can continue typing.

When you are finished typing, press the ENTER key twice to exit from power typing and re-enter edit mode. The editor automatically divides the data into appropriate screen lines and reconstructs any split words.

During an editing session, you can use power typing at any time by entering the POWER subcammand. The data

4-7 entered using power typing is inserted after the current line, as it is when you use the INPUT subcommand.

The screen changes in several ways in power typing mode: the prefix and status areas disappear; the line that was current when the POWER subcommand was entered moves to the top of the screen, and the rest of the screen is available for typing data.

Causing a Break in If you want to cause a break in the data that you type in the Data power typing mode, that is, you want -data to start on a new line, you can type a line end character before the data that you want to start on a new line. The default line end character is a pound sign (#).

For example, if the following data is typed in power typ- ing mode:

c #c driver program for solving system #c

The data will be entered in the file as:

__--- C C _____ , DRIVER PROGRAM FOR SOLVING SYSTEM ____- C

Inserting If you want to insert characters or spaces in a line Characters while you are in power typing mode, you can use the in- sert mode key. When characters are inserted, the entire stream of data shifts to the right; it's like inserting a box car in a train. Remember to press the RESET key when you are finished inserting characters.

Using Progjra Each PF key is set to an XEDIT subccmmand, which is exe- Fu Keys cuted when the key is pressed. Using the PF key saves you the time it takes to type that subcommand on the ccm- mand line and press the ENTER key.

You can use the following subcommand to display the PF key settings:

===> QUERY PF

The initial settings are as follows:

4-8 PF1 HELP MENU PF2 SOSLINEADD PF3 QUIT PF4 TABKEY PF5 SCHANGE 6 PF6 ? PF7 BACKWARD PF8 FORWARD PF9 = PF10 SPLIT CURSOR PFll JOIN CURSOR PF12 CURSOR COLUMN

These are the subcommands that the editor assigns to the PF keys. (See Appendix C for configuration of PF keys on your terminal). If you would rather have a different subcamnand assigned to one (or more) of the PF keys, you can use the SET PF subcommand, whose format is as fol- lows:

===> SET PFn subcommand

where "n" is a PF key number, and "subcommand" is any XEDIT subcommand.

For example:

===> set pfl input

assigns the INPUT subcommand to the PF1 key. Pressing the PF1 key would immediately place you in input mode.

When you assign a subcommand to a PF key, the setting remains in effect only for the current editing session. In the next editing session, the initial settings shown above are in effect.

The following sections show how to use some of the PF keys (initial settings). Others will be discussed where appropriate.

Splitting and Two PF keys that are useful in text processing are PF10 Joining Lines and PFll, which allow you to split and join lines, respectively, at the cursor position.

Splitting a Line (PF10) To split a line in two, simply move the cursor under the character where you want the line to be split, and press the PF10 key.

In the following line, the cursor is placed under the "I" in "IN".

4-9 ===== BIRD SPECIES HAVE DWINDTED IN THE LAST 70 MILLION YEARS.

When the PF10 key is pressed, the line is split in two:

===== BIRD SPECIES HAVE DWINDTED ===== IN THE LAST 70 MILLION YEARS.

Now there's room to add information on the line:

===== BIRD SPECIES HAVE DWINDLED FROM 1.5 MILLION TO 10,000 IN-==== THE LAST 70 MILLION YEARS.

Joining Two Lines (PFll) Pressing the PF11 key joins two lines at the cursor position.

For example:

===== These lines are …=====tooshort.

Note the cursor position above. Pressing the PFll key produces the following line:

===== These lines are too short.

Keep in mind that the line that is appended, or joined, overlays any data that follows the cursor.

For example:

===== The phrase "Things get worse under pressure" ===== is to be deleted.

Pressing the PFll key overlays the data that follows the cursor in the first line and results in the following:

===== The phrase is to be deleted.

Scrolling BaRckard When a file is too long to fit on one screen, you can use and Ftorward the PF7 and PF8 keys to scroll back and forth through the file.

Pressing the PF7 key, which is set to the BACKWARD sub- commnand, scrolls the screen backward, toward the top of the file, for one screen display.

Conversely, pressing the PF8 key, which is set to the FORWARD subcommand, scrolls the screen forward, toward the end of the file, for one screen display.

4-10 You can press either key repeatedly to scroll back or forth for as many screens as you wish.

eisplaying a After a subcommand that has been typed in the command Subxaaoml line is executed, the command line is cleared. If you use a PF key, the subcommand doesn't appear in the cxn- mand line at all. Sometimes, you'd like to be able to see the last subcommand that was executed. Perhaps you pressed the wrong PF key, or you didn't enter a subcom- mand the way you intended to.

Pressing the PF6 key (which is set to the ? subcommand) displays, in the command line, the last subcommand that was executed.

You can then re-execute the subcommand simply by. pressing the ENTER key. If the subccmmand was entered incorrect- ly, you can correct the error by typing over the subcom- mand displayed in the command line and then pressing the ENTER key.

eting a Use the PF9 key, which is set to the = subcammand, to Suoonaa re-execute the last subcomrmand entered. The subcommand does not appear in the command line, as it does when the PF6 key (which is set to the ? subcommand) is used.

Each time the PF9 key is pressed, the subcommand is exe- cuted, thereby saving you the time it takes to re-type the subcommand.

Inserting ibx& in a Ting

Using the PA2 Key One way to insert letters, spaces, or words in a line is by pressing the PA2 key (or its equivalent) and then by using the insert mode key.

The PA2 key replaces blank spaces at the end of a line with null characters; it "makes room" for the characters in the line to be shifted over so that new ones can be inserted.

The PA2 key operates on only one line at a time; if you move the cursor to another line and want to use insert mode, you must press the PA2 key again.

Remember to press the RESET key when you are finished us- ing insert mode.

This method may be used in both input mode and edit mode, but not in power typing mode. You cannot set the PA2 key to any other function.

4-11 Using PREFIX Prefix subcommands are one-character commands used to Sdbcs perform basic editing tasks on a particular line.

The following prefix subcommands are described in this section:

A (add) D (delete) I! (duplicate) M (move) C (copy) F (following) P (preceding) / (set current line)

Prefix subcomands are entered by typing over any posi- tion of the five-character prefix area on one or more lines. When the ENTER key is pressed, all of the prefix subcommands that have been typed on the screen are exe- cuted.

-Awwv andi Deleting L~

A Prefix To add a line, type the single character "A" in the pre- Subcommand fix area. When the ENTER key is pressed, a blank line is inserted immediately following the line containing the "A". A number may precede or follow the "A" to indicate that more than one line is to be added. For example, "A5" causes five blank lines to be added.

The following are valid ways to type the A prefix subcom- mand.

====A Adds one blank line after this line. a== Adds one blank line after this line. 10a== Adds ten blank lines after this line. ===A5 Adds five blank lines after this line.

4-12 Information may then be typed in the added lines. If no information is typed, the blank lines remain in the file throughout the editing session and after the file is written to disk.

D Prefix To delete a line, enter the single character "D" in the Subcommand prefix area of a line.

A number may precede or follow the "D" to indicate that more than one line is to be deleted.

To delete a group of consecutive lines, that is, a block of lines, you can enter the double character "DD" in the prefix area of both the first and last lines to be delet- ed. This method makes it unnecessary for you to count the number of lines to be deleted.

For example:

==dd= This is the first line I want to remove. ===== This is the second. ===== This is the third. ===-= This is the fourth. ===dd This is the fifth.

When the ENTER key is pressed, the above lines are deleted.

The first and last lines of the block need not be on the same screen; you may scroll the screen before entering the second "DD". When one "DD" has been typed and the ENTER key pressed, the status area of the screen displays "BLOCK INCOMPLETE". You can use the PF7 or PF8 keys to scroll the screen until you find the last line of the block, and then type "DD" in its prefix area. When the ENTER key is pressed, the entire block of lines is deleted.

Lost and Found If you delete one or more lines, you can recover them at Department any time during an editing session by using the RECOVER subcommand.

The following subcommand returns lines deleted in an editing session:

===> RECOVER n

where "n" represents the number of lines you wish to recover.

The recovered line(s) is inserted immediately before the current line. If the lines were deleted from different places in the file, you'll have to put them back where

4-13 they belong (by using the M prefix subcommand, discussed below.)

If you want to recover all lines that were deleted during an editing session, use the form:

===> RECOVER * IL~ Li~ To duplicate a line, enter the character " (double quote) in the prefix area of a line. A number may precede or follow the " to duplicate the line more than one time. For example:

=3"== I want three more copies of this line. ===== The end.

When the ENTER key is pressed, the file looks like this:

I want three more copies of this line. I want three more copies of this line. I want three more copies of this line. I want three more copies of this line. The end.

To duplicate a block of lines either one time or a speci- fied number of times, you can type "" (two double quotes) in the first and last lines of the block. A number can precede or follow the first "" (for example, 5"") to duplicate the block more than one time.

When one "" has been typed and the ENTER key pressed, the status area of the screen displays "BLOCK INCOMPLETE". This allows you to scroll the screen before completing the block and pressing the ENTER key. onviPM ii cjb fluv~Laes To move one line, enter the single character "M" in the prefix area of the line to be moved. You must indicate its destination by entering either the character "F" (following) or "P" (preceding) in the prefix area of another line.

When the ENTER key is pressed, the line containing the "M" is removed from its original location and is inserted in one of the following:

* immediately following the line containing the "F"

* immediately preceding the line containing the "P"

A number may precede or follow the "M" to indicate that more than one line is to be moved, for example, "5M" or "M5".

4-14 The line to be moved and the destination line can be on different screens. When either an "M" or "F" (or "P") has been entered, the status area of the screen displays "COPY/MOVE PENDING". This pending status allows you to scroll the screen before entering the other prefix sub- command.

To move a block of lines, enter the double character "MM" in the prefix area of both the first and last lines to be moved. The first and last lines to be moved, and the destination line may all be on different screens. You can use PF keys to scroll the screen before pressing the ENTER key.

The procedure for copying lines is the same as for moving lines, except that a "C" or "CC" prefix subcommand is used instead of "M" or "MM". The copy operation leaves the original line(s) in place, and makes a copy at the destination line, which must be indicated by "F" or "P".

The next example is a before-and-after picture of the delete, add and move features.

DRIVER FORTRAN Al F 80 TRUNC=72 SIZE=21 LINE=9 COLUMN=l

===== * * * TOP OF FILE * * * ===DD C ===== C DRIVER PROGRAM FOR SOLVING SYSTEM =DD== C ..==.= COMMON /BIGBLK/ XLIN(25), AMTRX(32,25), BLIN(32) D=--== C ===M= CALL INITRD .==.= CALL SOLVE (32,25,AMTRX,XLIN,BLIN) === |...... 1...... 2 ....+ ....3....+.. ...4...... 5*.+.... 6***+>.... ===-:F CALL ENDPR (25,XLIN) 2"=== END ===== * * * END OF FILE * * *

=-----> XEDIT 1 FILE

4-15 DRIVER FORTRAN Al F 80 TRUNC=72 SIZE=7 LINE=9 COLUMN=1 * * * TOP OF FILE * * * =====MMON /BIGBLK/ XLIN(25), AMTRX(32,25), BLIN(32) CALL SOLVE (32,25 ,AMTRX ,XLIN,BLIN) =====... +....1...+....2...+....3....+....4....+....5....+....6....+> CALL ENDPR (25,XLIN) =====CALL INITRD END END ===== END * * * END OF FILE * * *

--= ==-> XEDIT 1 FILE

Setting the Many subcommands begin their operations starting with the current Line V) current line. For example, the INPUT subcommand makes room for you to enter data after the current line. You have already seen the INPUT subcomnand used to insert lines after the TOP OF FILE line.

The / (diagonal) prefix subcommand can be typed in the prefix area of any line on the screen. When the ENTER key is pressed, that line becomes the current line. Then, if you enter an INPUT subcommand, the new lines en- tered in input mode will be inserted between the current line and the line that followed it.

Canlilng Prefix If you have entered one or more prefix subcommands that Sdb,__,,,ds create a "BLOCK INCOMPLETE" or a "COPY/MOVE PENDING" status, you can cancel all these prefix subcommands by entering the following subcommand in the command line:

---==> RESET

When the ENTER key is pressed, all prefix subcommands disappear from the display and the prefix areas are restored with equals signs (=====).

If you have typed any prefix subcommands (even those that do not cause an incomplete or pending status) but have not yet pressed the ENTER key, you can press the CLEAR

4-16 key to remove them.

Mbving ThrQugh a The following subcommands are discussed in this section: File BACKWARD FORWARD TOP BOTTCM UP DOWN

---- D and Scrolling the screen is like turning the pages of a book. You have already seen that the PF7 and PF8 keys are set &&W-Vmds to the BACKWARD and FORWARD subcommands, which scroll one full screen backward or forward. The BACKWARD and FOR- WARD subcommands can also be entered in the command line.

The format of these subcommands is:

===> BACKWARD n ===> FORWARD n

where "n" is the number of screen displays you want to scroll backward or forward. (This is like pressing the PF7 or PF8 key "n" times.) If you omit "n", the editor scrolls one screen backward or forward.

If you enter a BACKWARD subcommand when the current line is the "TOP OF FILE" line, the editor "wraps around" the file, making the last line of the file the new current line. Similarly, if you enter a FORWARD subcommand when the current line is the "END OF FILE" line, the editor makes the first line of the file the new current line.

¶~~Waixi fflI1~~~X Suppose the file is many screens long, and the current screen display is somewhere in the middle of the file. To go back to the beginning of the file, you could enter multiple BACKWARD subconmnands, or you could enter the TOP subcommand. The TOP subcommand makes the "TOP OF FILE" line the new current line. Its format is:

===> TOP

The BOTTOM subcommand makes the last line of the file the new current line. Its format is:

===> BCYICM

These subcommands are useful when you want to insert new lines either at the beginning or end of a file. The TOP subcommand followed by an INPUT or POWER subcommand makes room for you to add lines at the beginning of a file; use the BOTTOM subcommand followed by INPUT or POWER to add

4-17 lines to the end of a file.

DMandIUP Suppose that you want to move the file up or down a few a, ' -.d lines instead of a whole screen. The DOWN subcommand ad- vances the line pointer one or more lines toward the end of a file. The line pointed to becomes the new current line. For example:

===>-- down 5

makes the fifth line down from the current line the new current line. If the number is omitted, "1" is assumed.

The UP subcommand moves the line pointer toward the beginning of the file. The line pointed to becomes the new current line. For example:

===> up 5

makes the fifth line up from the current line the new current line. If a number is omitted, "1" is assumed.

The next example shows a before-and-after picture of the DOWN subcommand.

Chmiles in When you're looking at a screen of data that you have a FUe just entered and decide to make some changes, it's easy to type over the information to be changed.

However, it's not always that simple. Typically, you have numerous files stored on direct access devices and need to make changes even though you don't know exactly where the data is located in a file.

The challenge is two-fold: find the data; then change it.

The following subcommands are discussed in this section:

CLOCATE CHANGE CINSERT CFIRST

The CLOCATE subcommand searches a file, beginning with the current column in the current line, for a character string that you specify.

If the string is located, two things happen:

* The line containing the string becomes the new current line; however, if the string is in the current line, the line pointer does not move.

4-18 * The column pointer, represented in the scale as a vertical bar (|), moves under the first character of the string.

These changes are reflected in the file identification area at the top of the screen (LINE=nnn and COLUMN=nn).

One format of the CLOCATE subccmnand is as follows:

===> CLCATE/string/

The string must be enclosed in delimiters. In the exam- ples used in this book, the delimiter is a diagonal (/); however, you can use any character that does not appear in the string itself (for example, CLOCATE.VM/CMS.).

In the following example, \the string to be located is in the current line. Therefore, the line pointer does not move, but look what happens to the column pointer:

===== To be or not to be - that is the question. ...+ ....1.... + ....2 ....+.... 3 ....+....4....+....5....+....6....+>.

=====CLOCATE/be/

===== To be or not to be - that is the question. <..o+...1..+o...... o3e.... + ....4...+....5....+....6....+>

Notice that the column pointer in the scale has moved under the first character (b) in the string (be).

If you wanted to find all occurrences of "be" throughout the file, you could enter the CLOCATE/be/ subcommand repeatedly (or use the PF9 key, which is set to the = subcommand, for repeated execution). If a string appears more than once in a line, as in the example above, the line pointer remains the same, but the column pointer moves under the next occurrence of the string.

For example, if the CLOCATE/be/ subcommand is entered again, the line looks like this:

===== To be or not to be - that is the question. <...+....1....+....| ...... 3....+ ....4....+....5*....+ ....6.... +>

Note the position of the column pointer, under the second "be".

Each time the CLOCATE/be/ subcommand is entered, the column pointer moves under the next occurrence of "be"; in addition, the line pointer advances, until all

4-19 occurrences of "be" have been found.

If the string that you re searching for is in a backward direction from the current line, toward the top of the file, you can tell the editor to search backward by typ- ing a minus sign (-) in front of the string. For exam- ple:

===> clocate -/glance/

is a backward search for "glance".

CiSKSSbo d Replacing one word with another is the simplest type of change. If the string you want to change is not in the current line, you can use the CLOCATE subcommand to move the line pointer to the line that contains the string. Then, you can use the following form of the CHANGE sub- command, which changes the first occurrence of a word in the current line:

===> CHANGE/oldword/newword/

For example:

===== A rose is a rose is a rose. I + ... 1 . + . 2 ...... 4....+...5....+....6....+> ......

===>-- change/rose/daisy/

(with apologies to Gertrude Stein)

===== A daisy is a rose is a rose.

Note that the editor automatically made room in the line for "daisy" even though it is longer than "rose". Con- versely, a word can be replaced by a shorter word; the editor removes extra blanks.

You can use the CLOCATE and CHANGE subcommands to locate and change any string in a file. If the line containing the string is the current line, you don't have to use a CLOCATE subcommand; the CHANGE subcommand both locates and changes it.

Making a Selective Suppose you want to change one word to another only some Change of the time, that is, you want to make a selective, or "safe" change. You can do this by locating (repeatedly) the string you want to change, and by entering a CHANGE subcommand only when you want to change the string. How- ever, thereAs an easier way.

4-20 All you have to do is type a CHANGE subcommand (in the form CHANGE/oldword/newword) in the command line. Then, use the PF5 key to locate each occurrence of the old word, examine it, and then either change it (by pressing the PF6 key), or go on to the next occurrence (by press- ing the PF5 key).

Here's how to make a selective change:

1. Move the line pointer to the line where you want the search to begin. (You can use TOP, /, DOWN, or UP.)

2. Type a CHANGE subccmiand (CHANGE/oldword/newword) in the command line, but don't press the ENTER key.

3. Press the PF5 key. The cursor moves under the first occurrence of the old word, and the line that con- tains it is highlighted.

4. If you want to change the word, press the PF6 key. If not, press the PF5 key again, and step number 3 (above) will be repeated.

Using this sequence, you can locate all the occurrences of the old word, and press the PF6 key to change it only when desired. When all occurrences of the old word on one screen have been located, the editor scrolls the screen forward automatically.

If you want to locate all occurrences of a string, but you don't want to make any changes, you can type a CLOCATE/string/ subcommand instead of a CHANGE subcom- mand. Then, each time you press the PF5 key, the cursor moves under the next occurrence of the string and the line is highlighted. Pressing the PF6 key has no effect.

Making a Globa If you want to make a global change, that is, change Change every occurrence of a word throughout the file, first make sure that the first line of the file is the current line (via the TOP subccmmand) and use the following form of the CHANGE subcommand:

===> CHANGE/oldword/newword/ * *

For example:

=- *** *TOP OF FILE * * * --= A rose is a rose is a rose. --- A rose is a rose is a rose. --= A rose is a rose is a rose. =- A rose is a rose is- a rose. - ** * END OF FILE * * *

4-21 ===> change/rose/daisy/ * *

* * * TOP OF FILE * * * A daisy is a daisy is a daisy. A daisy is a daisy is a daisy. A daisy is a daisy is a daisy. A daisy is a daisy is a daisy. * * * END OF FILE * * *

This form of the CHANGE subcommand can also be used to make a global change starting in the middle of a file. Since the change starts with the current line, you would just make current (via /) that line where you want the change to begin.

Another variation of the CHANGE subcommand can be used if you want to change a word throughout the file, but you want to change only the first occurrence in each line:

===> CHANGE/oldword/newword/ *

Um 11 -cbd-w vmnnna Often, you need to insert words in a line. You have al- ready seen how to use the PA2 and insert mode keys and the SET NULLS subcommand. Another way to insert words is by using the CINSERT subcommand, which allows you to in- sert characters in the current line immediately before the column pointer.

You can use a CLOCATE/string/ subcommand to move the column pointer to the desired position. You can also use another form of the CLOCATE subcommand to move the column pointer:

===> CLOCATE :n

where ":n" represents an absolute column number, easily determined by looking at the scale.

In the following example, the CLOCATE subcommand is used to move the column pointer; then the CINSERT subcommand is used to insert characters immediately before the column pointer position.

===== If anything can go, it will. .--..+-....1.... +.... 2....+.... 3....+4.....4....+....5....+....6....+>

===> clocate/,/ or ===> clocate :19

(move the column pointer)

If anything can go, it will. < ...... 1 .... + .... 12..... 5...... +*....z4.... +...... 6....e+>

4-22 ===> cinsert wrong

(insert "wrong" before the column pointer)

===== If anything can go wrong, it will. <...+ 1 ...... * ... 12 +..3.... +.. 4....4...... +. ....5.... + ....6....+>

(In the CINSERT subcommand above, note that there are two spaces between "CINSERT" and "wrong": one is the required space between the subcommand name and the operand; one is the blank space needed between "go" and "wrong".)

If the inserted characters make the line longer than the screen line, the editor automatically "wraps around" to the next line. Even though the line is linger than a screen line, it is considered to be one logical line, with only one prefix area associated with it. Any prefix subcommands entered in the prefix area affect the entire logical line. For example, if a D prefix subcommand is entered, the whole sentence is deleted.

a~CYIIBT nS After using subcommands that move the column pointer, it's a good idea to reset the column pointer to column one by issuing the CFIRST subcommand.

For example:

===== If anything can go wrong, it will. <...+....1....+....2...!+.... 3...... 6....+>

===> cfirst

===== If anything can go wrong, it will. 1 ...+....1....+. .... *+*....3....+ 4 + 5....4....+....5+....+....6....+>

Setting Tabs Sometimes you may want to place information in specific columns. The PF4 key functions like a tab key on a type- writer. Each time the PF4 key is pressed, the cursor is positioned under the next tab column, where you can enter data.

Initial tab settings are defined by the editor according to filetype; they may be displayed by using the following subcommand:

===> QUERY TABS

You can change these settings one or more times during an editing session with the SET TABS subcommand. For exam- ple:

===> set tabs 10 20 30

4-23 The first time the PF4 key is pressed, the cursor moves to column 10 on the screen. The second time, it moves to column 20, and so forth.

The PF4 key may be used for tabbing in input mode, but not in power typing mode.

You can change the tab settings by issuing another SET TABS subcommand, or, of you'd like to see the current tab settings before changing them, you can use the following subconmand:

-==>MODIFY TABS

The current SET TABS subcommand is then displayed in the command line; you can type over the numbers and press the ENTER key to define new tabs.

The following subcommands are discussed in this section: Sessicn FILE QUIT SET AUTOSAVE

FILE S9 x 1m When you use the XEDIT command to create a new file, the file is created in virtual storage. When you make changes to an existing file, those changes are made to a copy of the file that is brought into virtual storage (when the XEDIT conmand is entered). However, virtual storage is temporary. To write a new or modified file on disk, which is permanent storage, you must enter the fol- lowing subcammand:

-==>FILE

When the FILE subcommand is executed, the file is written on disk and control is returned to CMS.

Chff -- Use the QUIT subcommand to end an editing session and leave the permanent copy of the file intact on the disk. If the file is new, it is not written on disk.

You can execute the QUIT subcommand either by pressing the PF3 key or by entering it on the command line, like this:

===> QUIT

You would use the QUIT subcommand instead of the FILE subcommand when you edit a file merely to examine, but not to change, its contents, or if you discover you have made errors in changing a file and do not want them to be recorded.

4-24 If a file is new or has been changed, the editor gives you a warning message to prevent the inadvertent use of a QUIT instead of a FILE. The message is as follows:

FILE HAS BEEN CHANGED. USE QQUIT TO QUIT ANYWAY.

If you really don't want to save the file, enter "QQUIT" (abbreviated as "QQ"). If you wish to save the changes, enter "FILE".

SK! A[lRS~SE Files on disk are not affected if the system malfunc- Sitxsxaan] tions, or "goes down." However, a new file that you're creating or the changes you're making to an existing file might be lost if the system fails. You can minimize this danger by using the SET AUTOSAVE subcommand, whose format is as follows:

===> SET AUTOSAVE n

The SET AUTOSAVE subcommand causes your file to be writ- ten to disk automatically, after you've typed in or changed a certain number of lines. You specify what that number will be with the "n" operand of the SET AUTOSAVE subcommand. If you want the file written to disk, or "saved", every time you've changed ten lines, enter the following subcommand:

-==> set autosave 10

The SET AUTOSAVE subcommand can be issued at any time during an editing session. It's a good idea, however, to issue the subcommand right after you issue an XEDIT com- mand to create a new file or to call an existing file from disk.

If you have issued a SET AUTOSAVE s6bcammand and the sys- tem goes down, your file is written to disk with a new fileid. The filename is a number, and the filetype is AUTOSAVE. You can change the fAleid back to its original filename and filetype by issuing the CMS command ERASE to erase the original file and then by issuing the CMS com- mand RENAME.

For example, if your AUTOSAVE file is labeled "1 AUTOSAVE Al" and the original file is "DRIVER FORTRAN Al", use the following CMS commands to rename it:

erase driver fortran rename 1 autosave al driver fortran al

Then you'll be back in business and can use the XEDIT command to start editing the file again.

4-25 A QUIT subcommand cancels a SET AUTOSAVE subcommand. If you issue a SET AUTOSAVE subcommand while you're creating a new file, and then issue a QUIT subcommand, the file is not saved. However, the AUTOSAVE file is available on disk. If you issue a SET AUTOSAVE subcommand while you're revising an existing file and then you issue a QUIT subcommand, no revisions are saved.

Inserting Data To insert all or part of one file into another file, you Frao Another File can use the GET subcommand. The GET subcommand inserts another file after the current line in the file you are editing. Therefore, you must move the line pointer to the desired line of the file. For example, of you want to insert another file at the end of a file, you can use the BOTTOM subcommand. If you want to insert another file in the middle of a file, you can use the / prefix subcommand to make the desired line current.

Inserting a WIole Suppose you were writing a program, and you created a File separate file for each subroutine. To combine two of the subroutines into one file, you would use the following form of the GET subcommand:

-==> GET filename filetype

When the entire second file has been inserted, the editor displays the message "EOF REACHED", indicating that the entire file has been inserted.

For example, if you were editing a file called DRIVERi FORTRAN and wanted to insert another file called DRIVER2 FORTRAN, you would enter the following subcommands.

===> bottom

(move the line pointer to the end of the first file)

===> get driver2 fortran

(insert the whole DRIVER2 program) InsertiJg Part of To insert part of another file, you can specify in the Another File GET subcommand the line number of the first line and the number of lines you want to insert. The following GET subccmnand inserts the first ten lines of a second file:

===> get file2 1 10

If you don't know the line numbers, you can: call out a second file without ending your current editing session; put the lines you want to insert into a temporary file; and insert them into your current file.

4-26 This might sound complicated, but all you need to learn is one more subcommand--PUT.

First, let's identify and explain the steps you would take to insert part of another file and then illustrate them with an example.

1. While editing the first file, enter an XEDIT subcom- mand to call out the second file. (You do not have to end your current editing session, because the editor allows you to edit multiple files simultane- ously.) The second file will appear on the screen.

2. Use the PUT subcommand to indicate which lines are to be inserted in the first file. The PUT subcom- mand stores lines in a temporary holding area, starting with the current line, up to an ending, or target, line. Its format is as follows:

===> PUT target

where "target" identifies the end of the group of lines to be inserted. It is a signal to the editor to stop "putting" lines.

A target operand may be specified in various ways. A brief description of three ways to specify a tar- get follows. They are all equivalent; you can choose whichever type you prefer.

One way to specify the target is to count the number of lines you want to insert, starting with the current line. For example, if a file contains:

===--= a loaf of bread ===== a jug of wine ==--= thou ===== a portable television

and the line containing "a loaf of bread" is current, the following subcammand stores all the above lines:

===> PUT 4

Another way to specify the target is with a charac- ter string: the editor will "put" all the lines, beginning with the current line, up to, but not including, the line containing the string.

For example, the following subcommand will "put" the first three lines, but it will not "put" the line containing "a portable television".

4-27 ===> PUT/television/

A third way to specify a target is the file line number. To display the line numbers in the prefix area, you must issue the following subcommand:

===> SET NUMBER ON

Here's how the above lines might look:

00010 a loaf of bread 00011 a jug of wine 00012 thou 00013 a portable television

To specify a target as a line number, type a colon (:) followed by the line number.

The following subcommand puts lines up to, but not including, line 13.

===> put :13

3. Enter a QUIT subcommand. The first file reappears on the screen.

4. Make sure that the current line is the line after which you want the lines from the second file to be inserted. Then enter the following subcommand:

===> get

No operands are required. The lines that were stored by the PUT subccmmand are inserted; the last line inserted becomes the new current line.

The next example shows how the PUT and GET subcommands are used to insert part of a file into another file:

4-28 SETUP FORTRAN Al F 80 TRUNC=72 SIZE=4 LINE=1 COLUMN=l

===== * * * TOP OF FILE * * * ===== . SUBROUTINE INITRD ====| +. 1...... +.. + .3.3 ... + .3 ....w44...... *+ ....5 .....+ . ...6 +> ==.== CALL RDMAT (32,25,AMTrRX) CALL RDVECT (32,BLIN) ==== RETURN END

=====* * * END OF FILE * * *

===> xedit driver fortran XEDIT 1 FILE

DRIVER FORTRAN Al F 80 TRUNC=72 SIZE=5 LINE=l COLUMN=l

===== * * * TOP OF FILE * * * =====CMMON /BIGBLK/ XLIN(25), AMTRX(32,25), BLIN(32) == ...... 1 ..... + ..... 22....+.... 3....+....4....+....5....+ .... 6....+> ===== CALL SOLVE (32,25,AMTRXx,XLIN,BLIN) .=.== CALL ENDPR (25,XLIN) ===== CALL INITRD END

.=.==* * * END OF FILE * * *

===> put 1 XEDIT 2 FILES

4-29 SETUP FORTRAN Al F 80 TRUNC=72 SIZE=5 LINE=2 COLUMN=l

====. * * * TOP OF FILE * * * SUBROUTINE INITRD =====O N /BIGBLK/ XLIN(25), AMTRX(32,25), BLIN(32) + =====...| e 1 . **ee.+. . **....2 .** + ..3.**. + e*e.*.e. 4 ..+ e. 5 *.e. + . 6 +> CALL RDMAT (32,25,AMTRX) CALL RDVECT (32,BLIN) ===== RETURN ===== END

===== * * * END OF FILE * * *

===> XEDIT 1 FILE

The file SETUP FORTRAN contains the initialization rou- tine for the DRIVER program used in the other examples in this section. In this example, the COMMON block defini- tion statement will be copied from the main program to the subroutine. First make the desired line current (via /) in the file SETUP FORTRAN. Since the COMMON statement will follow the line containing the subroutine name, the first line of the program will be the current line. Then enter the following subcommand:

===> XEDIT DRIVER FORTRAN

This file appears on the screen. The status area (lower right corner) indicates that two files are being edited. Move the line pointer to the line containing the COMMON statement, and enter the PUT command.

==> DOWN -==> PUT 1

The line is now stored.

===> QUIT

The original file comes back on the screen. Now enter the following subcommand to insert the line that was "put":

4-30 The COMCMON statement is inserted. It is now the current line.

Getting Help If you forget how to use a subcommand or would like to see information about subcommands not covered in this subset, you can press the PF1 key, which is set to the HELP MENU subcommand.

When the PF1 key is pressed, a list of all subcommands and macros available with the editor appears on the screen. You then move the cursor to the desired subcom- mand and press the appropriate PF key (which is defined on the screen). The subcommand description appears on the screen, replacing the file display. Pressing the PF12 key takes you out of the HELP display and restores your file on the screen.

Learning More The following is a list of additional XEDIT subcommands Abft: themditoc that are useful in text processing. You can learn how to use them by using the HELP facility (described above) or be referring to the publication VM/SP: System Product Editor Command and Macro Reference.

ALTER Allows you to change a character to one that is not available on your keyboard, like a backspace character.

COMPRESS, EXPAND Allow you to reposition data in new tab columns without retyping it.

LEFT, RIGHT Allow you to view columns of data that extend to the left or right of the screen display.

LKEPRCAS, UPPERCAS Allow you to translate alphabetic characters to all lowercase or all uppercase.

SET ARBCHAR Allows you to specify only the beginning and end of a long string that is to be located or changed.

SET CASE Allows you to choose whether data that is typed on the terminal is to be entered in the file the same way you type it or translated into uppercase.

SET POINT Allows you to assign a name to any line; you can refer- ence the name in XEDIT subcommands,

SET SCREEN Allows you to view multiple files or multiple views of the same file on one screen.

SET VERIFY Allows you to view only specified columns of data, in character or hexadecimal or both.

4-31 SORT Allows you to arrange the file lines in alphabetical ord- er.

S of XHITO The following table summarizes the subcommands that have Subset been presented in this chapter. When a subcommand can be abbreviated, its minimum abbreviation is shown in upper- case letters.

4-32 ------Function 1, Subcommand/PF Key ------

:: I To create or edit a file XEDIT (CMS command) ------To enter data Input PfWerinp

To scroll the screen BAckward FOward TOP

I Bottom ...... _ _ __--______--...------...------

I To move the line pointer | Down, Up

I To move the column pointer | CLocate, CFirst

I To locate data | CLocate

To make changes to the file Change, CInsert CDelete, CAppend

I To recover deleted data | RECover

To set tabs SET TABS MODify TABS .______-______-______

I To display current tab settings Query TABS

- ______- .__ __

I To display line numbers in the prefix area SET NUMber ON

- ______- .____ To end an editing session without saving the QUIT changes

- To save automatically after changing a I SET AUtosave specified number of lines

- To save the changed file when you have I FILE finished working on it

- To store lines to be inserted in another I PUT file by a subsequent GET

- To imbed a complete or a partial copy IGE of one file in another

- I To cancel pending prefix subcommands I RESet ______…______-…------

4-33 ------Prefix Subcommands

1..___.

To add lines I A 1. ______---___-__-______To delete lines D

1..___^ To duplicate lines I if

1..___. ------To move lines M and F or P

1..___. ______------____O______- To copy lines C and F or P

1..___. ______------______I To set the current line ______, ------______To get a HELP display PF1 I---- ______------______To add a line PF2

1.___. ______------______- To end a session without saving PF3

1.And__" ______.------______To use a tab key PF4 1.___ --______------__ ------To locate and change selectively PF51 PF6

1.___. ______------______To redisplay a subcommand PF6

1.___ -_ - _- ______- _ _------______To scroll one screen backward PF7

1.______------______To scroll one screen forward PF8

1.______------______- To repeat previous subcommand PF9

1.______. ______I To split a line at the cursor PF10 -_-______------______- To join two lines at the cursor PF11 I---- ~ mm_ m _ ~ ~ ~ m~_------______

I To move cursor to current column PF12

------

4-34 1IE IBM 4341 LnE When you finish this section, you should have a working zIF UIS knowledge of the line editor. The subcommands presented here comprise a subset of XEDIT subcommands, with which you can create a file, enter data, make changes to the file, and transfer data between files. The editor has many additional capabilities, which are described in the publications VM/SP: System Product Editor Command and Macro Reference and VM/SP: System Product Editor User s Guide.

This subset has been selected for text processing on a typewriter terminal. For an explanation of the full- screen editing capabilities, see the first section of this chapter.

Editing a File To edit a file means to make changes, additions, or dele- tions to a CMS file that is on a disk, and to make these changes interactively: you instruct the editor to make a change, the editor makes it, and then you request another change.

Creating a File You can edit a file that does not exist; when you do so, you are creating a file.

HX!IT Qat After you log on to VM/SP and enter the CMS environment, you are ready to enter the edit environment.

The editor is invoked with the CMS command XEDIT, whose format is as follows:

XEDIT filename filetype

Since you did not specify the fileid, the system searches your minidisks in alphabetical order for an existing "filename filetype." If such a file exists, a copy of that file is brought into virtual storage; then you can use XEDIT subcommands to make changes or corrections to lines in that file. You enter an XEDIT subcommand by typing the subcamnand and then pressing the RETURN key. (XEDIT subcommands, like CMS commands, can be typed in either uppercase or lowercase, or a combination of both.)

If the file is not found on any of your minidisks, the editor creates it in virtual storage.

When a subcommand changes a line, the editor displays, or "verifies", the changed line. The editor also communi- cates with you by displaying error or information mes- sages. For purposes of illustration in this chapter, anything displayed by the editor is enclosed in a box. Subcommands or data that you would enter are not.

4-35 Now let½s create a simple file. Its filename and file- type will be DRIVER FORTRAN. The following command is entered to begin creating the file:

xedit driver fortran

Because the file is new, the editor responds with the following message:

CREATING NEW FILE:

Entering Data The following subcommands are discussed in this section:

INPUT QUERY LRECL SET CASE

IMPRT S and After you enter the XEDIT command, you are in edit mode. You must be in edit mode to enter XEDIT subcommands.

However, to enter data in the file, you must be in input mode. Type the following subcommand and press the RETURN key to enter input mode:

input

The editor displays the following message:

INPUT MODE:

You can then type in the data. Each line that you enter while in input mode is considered to be a data line and will be written in the file. To end a line, press the RETURN key; the line will then be inserted into the copy of the file in virtual storage.

No line may be longer than the logical record length of the file, which varies according to filetype. To find out the logical record length of any file, you can enter the following subccmmand (in edit mode):

query lrecl

In the examples used here, the filetype is FORTRAN, which has a logical record length of 80. If you type more than 80 characters in a line before pressing the RETURN key, the editor truncates the extra characters.

Now let s start typing lines to be entered in the file:

4-36 c c driver program for solving system c ccnmon /bigblk/ xlin(25), amtrx(32,25), blin(32) c call initrd call solve (32,25,amtrx,xlin,blin) call endpr (25,xlin) end

When you are finished typing data and want to return to edit mode (either to make changes to the file or to end the editing session), press the RETURN key on a null line, i.e. press the return key twice after typing the last line.

During an editing session, you can enter input mode at any time to insert new lines of data in the file. After the INPUT subcommand is entered, the editor inserts the lines you type after the current line. In this example, since the file is new, the lines are inserted at the beginning of the file. Later, you will see how to make any line the current line, so that you can insert lines between any two existing lines in a file.

This is how the data look in the file.

TOF: C C DRIVER PROGRAM FOR SOLVING SYSTEM C _O(43N /BIGBLK/ XLIN(25), AMTRX(32,25), BLIN(32) C CALL INITRD CALL SOLVE (32,25,AMTRX,XLIN,BLIN) CALL ENDPR (25,XLIN) _ END EOF:

Note: For FORTRAN-type files on 327X terminals, the line numbers are displayed in column positions 73-80. bDl]an Pointer Notice that the first letter in each line is underscored. This underscore character (_) is not contained in the file, and it will not appear on a printed copy of the file. It represents the column pointer.

Note that the column pointer will not appear on terminals that are not capable of underlining. This restriction applies to most NCAR screen terminals. Users of such terminals must exercise extra care in keeping track of the current column.

4-37 Various subcammands perform their editing functions within a line starting at the column pointer, which you can move to different column positions by using XEDIT subcommands that will be discussed later. The column under which the column pointer is positioned is called the current column. In the example above, the current column is column one.

Through a The following subcommands are discussed in this section: File TYPE UP DOWN TOP BOyTOM

When you use the XEDIT command to create a new file, the file is created in virtual storage. When the XEDIT com- mand is used to call out an existing file, a copy is brought into virtual storage. In either case, you can picture the file as a series of records, or lines; these lines are available for you to change or delete. You can also insert new lines following any line that is already in the file.

Lin Pointer The line that you are currently editing is called the current line.

Naturally, the line that is current changes as you move up and down in the file to edit various lines. When the line that is current changes, we say that the line pointer has moved. Many XEDIT subcommands perform their functions starting with the current line and move the line pointer when they are finished.

You can change which line is current, that is, you can move the line pointer, by using the subcommands discussed in this section.

What you do during an editing session is:

* Position the line pointer at the line you want to edit.

* Edit the line (change characters in it, delete it, or insert new lines following it).

* Position the line pointer at the next line you want to edit.

4-38 E SChuxxind Many XEDIT subcommands operate either on, or starting with the current line. For example, the INPUT subcommand inserts new lines of data after the current line. There- fore, you often need to determine which line is current so that you can move the line pointer, if necessary.

To display the current line, enter the TYPE subcommand, whose format is:

type

To display more than one line, enter the TYPE subcommand with the number of lines you want to see. For example, the following subcommand displays 5 lines, beginning with the current line:

type 5

To display the entire file, you must first position the line pointer at the top of the file. The following sub- commands move the line pointer to the top of the file and then display the entire file:

top

(moves the line pointer to the top of the file and displays "TOF:")

type *

(displays all the lines in the file)

After the TYPE subcommand is executed, the line pointer is positioned at the last line that was displayed. For example, if you type the entire file, the null "EOF" line will become the new current line. Of course, if you type only one (the current) line, the line pointer will not move.

D o UP a You can move the line pointer up or down one or more SL*.iX lines.

The UP subcommand moves the line pointer toward the be- ginning of the file and displays the new current line. Its format is:

up n

where "n" is the number of lines you want to move the line pointer. If the number is cmitted, "1" is assumed.

The DCWN subcammand moves the line pointer toward the end of the file and displays the new current line. Its

4-39 format is: down n

where "n" is the number of lines you want to move the line pointer. If the number is anmitted, "1" is assumed.

Let's look at the program file again: top

(move the line pointer to the top of the file)

TOF: type *

(display the whole file)

TOF: C C DRIVER PROGRAM FOR SOLVING SYSTEM C COMMON /BIGBLK/ XLIN(25), AMTRX(32,25), BLIN(32) C _ CALL INITRD CALL SOLVE (32,25,AMTRX,XLIN,BLIN) CALL ENDPR (25,XLIN)

=_ END EOF:

The TYPE * subcommand was used to display the entire file; since the last line displayed by a TYPE subcommand is the new current line, the "EOF" line is now the current line.

The following subcommands show how the UP and DCWN sub- commands are used to move the line pointer up and down in the file. Each time the line pointer is moved, the edi- tor displays the new current line. up 2

(move the line pointer up two lines from the EOF line)

CALL ENDPR (25,XLIN) down 1

(move the line pointer down one line)

4-40 END

To insert new lines of data after any existing file line, you can do the following:

* Issue the UP or DCWN subcommand to move the line pointer to the line after which you want the data to be inserted.

* Then enter the INPUT subcommand.

wxirJYIT You can also move the line pointer to the beginning or end of the file.

To move the line pointer to the null "TOF" line that pre- cedes the first line of the file, issue the following subcommand:

top

To move the line pointer to the last file line, issue the following subcormand:

bottom

To begin entering new lines either at the beginning or the end of a file, you can use the following sequence of subcommands:

top (or bottom) input

Then you enter new data lines. akng in The following subcmnands are discussed in this section: a File CLOCATE CFIRST CINSERT CDELETE CAPPEND CHANGE

Often, you need to insert or delete characters in a line or change one word to another. The subcommands discussed in this section enable you to insert, delete, or change characters based on the position of the column pointer, which is represented as an underscore character (_) when a line is displayed. This underscore does not appear on most NCAR screen terminals. Consequently, users must be careful to keep track of the current column.

4-41 dCXOaTE 9Ijixxmard The CLOCATE subcommand is used to move the column pointer to the column where you want to insert, delete, or change characters.

The CLOCATE subcommand searches a file, beginning with the current line, for a character string that you speci- fy. Its format is as follows:

CLOCATE/str ing/

The character string must be enclosed in delimiters. The slash (/) is the delimiter used in these examples, but it may be any character that does not also appear in the character string (for example, CLOCATE.VM/CMS.)

If the string is found, two things happen: the line that contains the string becomes the new current line (and is displayed); and the column pointer moves under the first character of the string. If the string is not found, the editor prints a message to that effect.

For example, in the file shown above, the subcommands:

top

(move the line pointer to the top of the file)

clocate/initrd/

(locate the string)

cause the following line to be displayed:

CALL INITRD

Notice that the line pointer moved to the line containing the string "INITRD", and the column pointer moved under the first character of the string. The column pointer will not be displayed on most NCAR screen terminals but its position is important.

After using subcommands that move the column pointer, it's a good idea to reset the column pointer to the be- ginning of the line. The following subcommand moves the column pointer to the beginning of the line:

cfirst

For example, in the line shown above, where the column pointer is under the "I" in "INITRD", issuing a CFIRST subccmmand results in:

4-42 CALL INITRD T h , I SE I . u c c . n . i , s d to i s rt c a a t e s i m The CINSERT subcommand is used to insert characters im- mediately before the column pointer.

For example, a file contains the following line:

Mt. Everest is high.

Note the position of the column pointer, in column one. To insert the phrase "exactly 29,000 feet" before the word "high", first move the column pointer to the first character in "high", by using the following subcommand: clocate/high/

The editor moves the column pointer and displays the line:

Mt. Everest is high.

Now you can insert the phrase:

cinsert exactly 29,000 feet

The editor inserts whatever you type in the operand of the CINSERT subcommand. In the subcommand above, the space bar was pressed once after the word "feet" so that a blank would separate "feet" and "high".

The resulting line is displayed:

Mt. Everest is exactly 29,000 feet high.

Let's look at another example. The CLOCATE subcommand is used to move the column pointer; then the CINSERT subcxm- mand is used to insert characters immediately before the column pointer position.

A file contains the following line:

If anything can go, it will.

clocate/,/

(move the column pointer)

4-43 If anything can go, it will.

cinsert wrong

(insert "wrong" before the column pointer)

If anything can go_wrong, it will.

(In the CINSERT subcommand above, note that there are two spaces between "CINSERT" and "wrong": one is the required space between the subcommand name and the operand; one is the blank space needed between "go" and "wrong".)

If only one blank space were used, the result would be the following:

If anything can gowrong, it will.

The editor allows you to insert blanks with the CINSERT subcommand--simply type the required number of blanks (by pressing the space bar) in the operand. For example:

If anything can gowrong, it will.l

cinsert

(Press the space bar twice: once to separate the subcommand name and operand; once for the operand.)

If anything can go wrong, it will.

E DESub and The CDELETE subcommand is used to delete one or more characters from the current line, starting at the column pointer.

A file contains the following line:

To be or not to be or not to be--that is the question.

The line contains one too many "or not to be". Since deletion starts at the column pointer, first move the column pointer with the following subconmmand: clocate/or/

To be or not to be or not to be-that is the question.

Then, you can use the CDELETE subcorrmand to specify the

4-44 number of characters to be deleted. Count the number of characters to be deleted, starting with the current column: cdelete 13

The resulting line looks like this:

To be or not to be--that is the question.

The CDELETE subcommand issued above specified a "13" as the operand; it means, "delete 13 characters, starting at the column pointer."

If you did not want to count the number of characters, you could have specified the operand of the CDELETE sub- command as a character string. For example: cdelete/or/

When this form of the CDELETE subcommand is used, it means, "delete characters from the column pointer to the first character of the string specified in the operand." The result would be the same as the line shown above; the extra "or not to be" would be removed.

In summary, the CDELETE subcommand removes characters from a line, from the column pointer to the column posi- tion specified in the operand. The operand may be speci- fied as the number of characters to be removed, or it may be specified as a character string. After the CDETE subcomiand is executed, the editor displays the changed line.

Use the CAPPEND subcommand to append words to the end of the current line.

The format of the CAPPEND subcommiand is:

cappend text where "text" represents the data you want to add to the end of the line.

For example, a file contains the following line:

It is an ancient mariner,

However, the line should read:

It is an ancient mariner, and he stoppeth one of three.

4-45 The following subcomnand adds the desired text:

cappend and he stoppeth one of three.

(Two blanks separate the subcommand name and the operand.)

The resulting line looks like this:

i It is an ancient mariner,_and he stoppeth one of three.-}

Notice that the column pointer has moved to the first character of the appended text, which was a blank.

Changing One Word Replacing one word with another is the simplest type of to Another change. Use the following form of the CHANGE subcrnmand to change the first occurrence of a word in the current line:

change/oldword/newword/

For example, the current line in a file contains the fol- lowing:

A rose is a rose is a rose.

change/rose/daisy/

The resulting line looks like this:

A daisy is a rose is a rose.

Note that the editor automatically makes room in the line for "daisy", even though it is longer than "rose". Con- versely, a word can be replaced by a shorter word; the editor removes extra blanks.

You can use the CLOCATE and CHANGE subcommands to locate and change any string in a file. If the line containing the string is the current line, you don't have to use a CLOCATE subcommand; the CHANGE subcommand both locates the string and changes it.

Making a Global If you want to make a global change, that is, change Change every occurrence of a word, first move the line pointer to the line where you want the change to begin, and use the following form:

change/oldword/newword/ * *

4-46 In the following example, the word "rose" is changed to "daisy" every time it appears. (The line pointer is already positioned at the first line shown.)

A rose is a rose is a rose. A rose is a rose is a rose. A rose is a rose is a rose. A rose is a rose is a rose.

change/rose/daisy/ * *

produces the following changes in the file (the editor displays only those lines that have been changed):

A daisy is a daisy is a daisy. A daisy is a daisy is a daisy. A daisy is a daisy is a daisy. A daisy is a daisy is a daisy.

Another variation of the CHANGE subcnmnand can be used when you want to change a word throughout the file, but you want to change only the first occurrence in each line:

change/oldword/newword/ *

Making a Selective Suppose that you want to change one word to another only Change sane of the time. You can use repeated executions of the CLOCATE subcorfnand to scan the file, issuing a CHANGE subcommand only when you want to make the change.

Instead of typing the same CLOCATE subcommand over and over, you can use the = subcommand, which repeats the last subcommand you entered. Using the = subcommand saves you the time it takes to retype the subcommand. To enter the =subccrmmand, simply type an equal sign (=) and press the RETURN key.

Inserting and The following subcommands are discussed in this section: Deleting Lines INPUT line DELETE RECOVER REPLACE

Inserting A Line You can insert a single line of data between existing lines by using the INPUT subcommnand followed by the line of data you want inserted. One blank must separate the subcommand name and the data line.

For example:

4-47 input this is the line I want to insert

inserts a single line following the current line, without leaving edit mode. (If you want to insert more than one line, you would issue the INPUT subcommand with no operand to enter input mode.)

To insert a blank line in the file, enter the INPUT sub- command and press the space bar at least twice before pressing the RETURN key. A blank line will be inserted after the current line.

For example, if a file contains the following lines:

TOF: SUBROUTINE ENDPR (NVECT) C C SUBROUTINE FOR PRINTING A REAL VECTOR C DIMENSION VECT (N) C WRITE (6,6000) 6000 FORMAT (' I VECT(I) ) DO 100 I = 1,N WRITE (6,6100) I, VECT(I)

_O1 CONTINUE 6100 FORMAT (I5,F8.4)

RETURN

The current line is the last line displayed above. To insert an END statement after the return statement, issue the following subcommand:

input end

Now the file looks like this (TOP and TYPE * are used to display the whole file):

4-48 TOF: SUBROUTINE ENDPR (N,VECT) C C SUBROUTINE FOR PRINTING A REAL VECTOR C DIMENSION VECT (N) C WRITE (6,6000) 6000 FORMAT (* I VECT(I) ) DO 100 I = 1,N WRITE (6,6100) I, VECT (I) 100 CONTINUE 6100 FORMAT (I5,F8.4)

RETURN END

To insert a blank line between RETURN and END, you could issue the following subcomands: up

(move the line pointer up one line)

input

(press the space bar twice before pressing the RETURN key)

Now the file looks like this:

TOF: SUBROUTINE ENDPR (N ,VECT) C C SUBROUTINE FOR PRINTING A REAL VECTOR C DIMENSION VCT (N) C WRITE (6,6000) 6000 FORMAT (' I VECT(I) ) DO 100 I = 1,N WRITE (6,6100) I, VECT(I) _00 CONTINUE 6100 FORMAT (I5,F8.4)

RETURN

END

4-49 Deleting Lines Use the DELETE subcommand to delete one or more lines from a file, beginning with the current line.

To delete only the current line, use the form:

delete

To delete more than one line, specify the number of lines in the operand:

delete 5

deletes five lines, including the current line.

To delete the rest of the file, use the form:

delete *

If you want to delete a number of lines, and you don't want to bother counting how many, you can use the form:

delete/string/

Lines will be deleted, starting with the current line, up to (but not including) the line containing the specified string.

For example, if a file contains the following lines, and the first line shown is the current line:

a portable television a transistor radio a frisbee a loaf of bread a jug of wine thou

The following subcommand:

delete/bread/

deletes all lines from the current line up to, but not including, the line containing "bread". Therefore, all that's left are the lines containing "a loaf of bread", "a jug of wine", and "thou".

Lost and Found If you delete one or more lines and change your mind, all Department is not lost. You can recover the lines at any time dur- ing an editing session with the RECOVER subcommand.

The following subcommand returns lines deleted in an editing session:

4-50 recover n

where n represents the number of lines you wish to recover.

The recovered line(s) is inserted immediately before the current line. If the lines were deleted from different places in the file, you have to put them back where they belong by using the MOVE subconmand, discussed below.

If you want to recover all lines that have been deleted during an editing session, use the form:

recover *

Replacing a Line You've seen how to insert a new line and delete a line, using INPUT line and DELETE. The REPLACE subcommand does both; it deletes the current line and replaces it with a line you specify.

The format of the REPLACE subconmmand is:

replace line

However, if you enter the REPLACE subcommand with no line, the editor deletes the current line and automati- cally places you in input mode.

MOVING AND COPYING The following subcommands are discussed in this section: LINES MOVE COPY

mom - Suppose you want to remove some lines from their current location and insert them in another part of the file. You can use the MOVE subcommand to move one or more lines, beginning with the current line, to a different location in the file. The format of the MOVE subcommand is as follows:

move from to

The first operand represents the number of lines to be moved, starting with the current line. The second operand represents the destination; the line(s) is inserted after the destination line and is deleted from its original location.

For example, to move the current line three lines down in the file, you can use the following subcammand:

move 1 3

4-51 To move the current line and the two lines following it three lines down in the file, you can use the following subcommand: move 3 3

To move a line backward in the file, you can specify a minus (-) sign in front of the "to" operand. For exam- ple: move 1 -3 moves the current line up two lines in the file. Remember, the "to" operand represents the line after which a line is to be moved; therefore, if the destina- tion is -3, the line is inserted after that line, or two lines up.

To eliminate the need for counting lines, you can specify the "to" operand as a character string. The editor searches the file for a line that contains the string and moves the "from" line(s) after that line.

For example: move 1 /string/ moves the current line after the line containing the string.

Similarly, you can move a line backward in the file by specifying a minus (-) sign before the string. For exam- ple: move 1 -/string/ moves the current line backward in the file after the line that contains the string.

Let's look at an example: filberts almonds cashews chestnuts pecans walnuts

The following subcommands would each move the line con- taining "filberts" (the current line) after the line con- taining "chestnuts".

4-52 move 1 3 or move 1 /chestnuts/

almonds cashews chestnuts filberts pecans walnuts

(ivy -C mv ~ The procedure for copying lines is the same as for moving lines. The COPY subcommand leaves the original line(s) in place and makes a duplicate at the indicated destina- tion.

The format of the COPY subcommand is:

copy from to

One or more lines, beginning with the current line, are copied after the destination line.

EE I 17 AN J iMG The following subcomnands are discussed in this section:

FILE QUIT SET AUTOSAVE

Fl]lE b W4I V When you use the XEDIT command to create a new file, the file is created in virtual storage. When you make changes to an existing file, those changes are made to a copy of the file that is brought into virtual storage (when the XEDIT command is entered). However, virtual storage is temporary. To write a new or modified file on disk, which is permanent storage, you must enter the fol- lowing subcocmand:

file

When the FILE subcommand is executed, the file is written on disk and control is returned to CMS.

-ff-- I Use the QUIT subcommand to end an editing session and leave the permanent copy of the file intact on the disk. If the file is new, it is not written on disk.

The format of the QUIT subcormand is as follows:

quit

You would use the QUIT subcommand instead of the FILE subcarmand when you edit a file merely to examine, but not to change, its contents, or if you discover you have made errors in changing a file and do not want them to be

4-53 recorded.

When a file is new or has been changed, the editor gives you a warning message to prevent the inadvertent use of a QUIT instead of a FILE. The message is as follows:

FILE HAS BEEN CHANGED. USE QQUIT TO QUIT ANYWAY.

If you really don't want to save the file, enter "QQUIT" (abbreviated as "QQ"). If you wish to save the changes, enter "FILE".

SEt AIDTESKE Files on disk are not affected if the system malfunc- Sub-a~--ad tions, or "goes down." However, a new file that you re creating or the changes you're making to an existing file might be lost if the system fails. You can minimize this danger by using the SET AUTOSAVE subcomnand, whose format is as follows:

set autosave n

The SET AUTOSAVE subcommand causes your file to be writ- ten to disk automatically, after you've typed in or changed a certain number of lines. You specify what that number will be with the "n" operand of the SET AUTOSAVE subconmand. If you want the file written to disk, or "saved", every time you've changed ten lines, the subcom- mand would be:

set autosave 10

The SET AUTOSAVE subcommand can be issued at any time during an editing session. It's a good idea, however, to issue the subccmnand right after you issue an XEDIT com- mand to create a new file or to call an existing file from disk.

If you have issued a SET AUTOSAVE subcormand and the sys- tem goes down, your file is written to disk with a new fileid. The filename is a number from 1 to 8, and the filetype is AUTOSAVE.

You can change the fileid back to its original filename and filetype by issuing the CMS command ERASE to erase the original file and then by issuing the CMS command RENAME.

For example, if your AUTOSAVE file is labeled "1 AUTOSAVE Al" and the original file is "DRIVER FORTRAN Al", use the following CMS commands to rename it:

4-54 erase driver fortran rename 1 autosave al driver fortran al

Then you'll be back in business and can use the XEDIT ccmmand to start editing the file again.

A QUIT subcommand cancels a SET AUTOSAVE subcommand. If you issue a SET AUTOSAVE subcomand while you're creating a new file, and then issue a QUIT subcommand, the file is not saved. If you issue a SET AUTOSAVE subcommand while you're revising an existing file and then you issue a QUIT subcommand, no revisions are saved.

Inserting Data To insert all or part of one file into another, you can fric Another File use the GET subcommand. (A file that you "get" is not destroyed; a copy of that file is inserted.)

The GET subcommand inserts a file after the current line. Therefore, you must move the line pointer to the line after which you want to insert a file. If you want to insert another file at the end of your file, you can use the BOTCTOM subcommand to make the last line current. If you want to insert another file somewhere in the middle of your file, you can use the UP or DCWN subcommands to make the desired line current.

Inserting a Whole Suppose you were writing a program, and you created a File separate file for each subroutine. To combine two of the subroutines into one file, you would use the following form of the GET subccmmand:

get filename filetype

When the entire second file has been inserted, the editor displays the following message:

EOF REACHED

For example, if you were editing a file called DRIVER1 FORTRAN and wanted to insert another file called DRIVER2 FORTRAN, you would enter the following subcommands:

bottom

(move the line pointer to the end of the file)

get driver2 fortran

(insert the whole file)

4-55 I tiPart of To insert part of another file, you can specify in the Another File GET subcommand the line number of the first line and the number of lines you want to insert. The following GET subconmand inserts the first ten lines of a second file: get file2 1 10

If you don't know the line numbers, you can: call out a second file without ending your current editing session; put the lines you want to insert into a temporary file; and insert them into your current file.

This might sound complicated, but all you need to learn is one more subcommand--PUT.

First, let's identify the steps you would take to insert part of another file and then illustrate them with an example.

1. While editing the first file, enter an XEDIT subcom- mand to call out the second file. You do not have to end your current editing session, because the editor allows you to edit multiple files simultane- ously.

2. Use the PUT subcommand to indicate which lines are to be inserted in the first file. The PUT subcom- mand stores lines in a temporary holding area, starting with the current line, up to an ending, or target, line. Its format is as follows:

put target

where "target" identifies the end of a group of lines to be inserted. It is a signal to the editor to stop "putting" lines.

A target operand may be specified in various ways, which are described in detail in "Chapter 4: Using Targets," in the IBM document IBM VM/SP: System Product Editor User s Guide. A brief description of two ways to specify a target follows. They are equivalent; you can choose whichever type you prefer.

One way to specify the target is to count the number of lines you want to insert, starting with the current line. For example, if a file contains:

a loaf of bread a jug of wine thou a portable television

4-56 and the line containing "a loaf of bread" is current, the following subcommand stores all the above lines:

put 4

Another way to specify the target is with a charac- ter string; the editor will "put" all the lines, beginning with the current line, up to, but not including, the line containing the string.

For example, the following subcommand will "put" the first three lines, but it will not "put" the line containing "a portable television".

put/television/

3. Enter a QUIT subcommand to return to your original file.

4. Make sure that the current line is the line after which you want to insert lines from the second file. Then enter the following subcommand:

get

No operands are required. The lines that were stored by the PUT subcommand are inserted; the last line inserted becomes the new current line.

The following example illustrates how the PUT and GET subcommands are used to insert part of a file into another file:

A file, SETUP FORTRAN, is being edited. It contains the initialization routine for the DRIVER program used in the first example in this section. In this case, the OOMMON block definition statements will be copied from the main program to the subroutine. xedit setup fortran

(Call out the first file.) type *

(Display the SETUP file.)

4-57 SUBROUTINE INITRD CALL RDMAT (32,25,AMTRX) CALL RDVECT (32,BLIN) _REURN END

down 1

(Move to the line after which the CCMN block statement is to be inserted.)

xedit driver fortran

(Edit the DRIVER program file which contains the COMMN statement.)

type *

(Display the DRIVER file.)

TOF: C C DRIVER PROGRAM FOR SOLVING SYSTEM C/ _(XKN //BIGBLK/ XLIN(25), AMTRX(32,25), BLIN(32)

_ CALL INITRD _ CALL SOLVE (32,25,AMTRX,XLIN,BLIN) _ CALL ENDPR (25,XLIN) _ END EOF:

top

(Move the line pointer to the beginning of the DRIVER file.) down 3

(Move the line pointer to the first line to be stored.) put/initrd/

Lines are stored, beginning with the comnent line preced- ing the COMMCN statement. and ending with the line preceding the one containing INITRD. The PUT subcommand could also be entered as PUT 3. quit

4-58 The file SETUP is now being edited.

get

The COMMON block statement is inserted.

The resulting file looks like this:

SUBROUTINE INITRD

_ OCOMMON /BIGBLK/XLIN(25) ,AMTRX(32,25) ,BLIN (32) C CALL RDMAT (32,25,AMTRX) CALL RDVECT (32,BLIN) RETRN END

lsing Special The following subcommands are discussed in this section: TabCharacters SET IMAGE SET TABS QUERY TABS

The SET IMAGE subcommand controls how special characters, once entered on an input line, are going to be represented in a file. The special characters affected by the SET IMAGE subcommand are:

* tab characters (X'05')

* backspace characters (X'16')

The format of the SET IMAGE subcommand is:

set image on off canon

Tab Characters The important thing to remember about tab settings is that there are two kinds: physical and logical.

Physical tab settings are set manually on the typewriter; each time you press the TAB key, the type ball moves to the column you set up as the physical tab stop.

Logical tab settings indicate the column positions where fields within a record begin. They are defined by the SET TABS subcommand, whose format is:

4-59 set tabs nl n2 n3 ...

where nl...represents the column numbers for the logical tab settings.

These logical tab settings do not necessarily correspond to the physical tab settings.

How- the data is entered in the file when you press the TAB key depends on whether the SET IMAGE subcommnand has been issued with ON or OFF as the operand. (SET IMAGE ON is the initial setting for all filetypes except SCRIPT.)

If SET IMAGE ON is in effect when you press the TAB key, the logical tab settings determine how the data will be entered in the file. The editor replaces the tab charac- ters with an appropriate number of blanks, starting at the column where you pressed the TAB key, and ending at the last column before the next logical tab setting. The next character entered after the tab becomes the first character of the next field.

For example, if you enter:

set tabs 1 15

and then enter a line that begins with a tab character, the first data character following the tab is written into the file in column 15, regardless of the physical tab stop on the terminal.

If SET IMAGE OFF is in effect, a tab character is inserted in the record, just as any other data character is inserted. No blanks are inserted.

If you want to insert a tab character (X'05') into a record and SET IMAGE ON is in effect, you can issue a SET IMAGE OFF subcommand before entering the line, and then use the TAB key as a character key. Pressing the TAB key causes a tab character to be inserted in a line.

Setting Tabs When you create a file, default logical tab settings are in effect; therefore, you do not need to set them. To determine the default tab settings for a particular file- type, you can use the following subcommand:

query tabs

If you want to change the default tab settings, you can use the SET TABS subcommand. Then, regardless of what physical tab stops have been set up on your terminal, when you press the TAB key with SET IMAGE ON in effect, the data you enter is spaced to the columns you defined.

4-60 Note: When the INPUT subcormmand is used to enter one line, the specified line is placed in the file starting in the first tab column defined by the SET TABS subcom- mand. For example, if you enter:

set tabs 5 10 15 20

and then enter an input line:

input This is the input line

columns 1, 2, 3, and 4 contain blanks; the text begins in column 5.

Therefore, make sure that the first number specified in the SET TABS subccmnand is the column in which you want the data to begin.

Backspace If you use backspaces and underscores in your file, you Characters should issue SET IMAGE OFF or SET IMAGE CANON. SET IMAGE CANON is the initial setting for SCRIPT files. (SCRIPT is not available at this time.)

SET IMAGE OFF means that backspace characters (as well as tab characters) are left as they are entered.

SET IMAGE CANON means that regardless of how the charac- ters are typed in (characters, backspaces, underscores), the editor orders the characters in the file as: character - backspace - underscore, character - backspace - underscore, and so forth. If, for example, you want an input line to look like this:

ABC

You could enter it as:

ABC, 3 backspaces, 3 underscores

- or -

3 underscores, 3 backspaces, ABC

A typewriter types out the line in the following order:

A, backspace, underscore B, backspace, underscore C, backspace, underscore

which results in:

ABC

4-61 If you need to nodify a line that has backspaces, and you do not want to rekey all of the characters, you can use the ALTER subcomiand to alter all of the backspaces to some other character. The following sequence shows how you can delete all of the backspace characters in a line:

AAAAA

alter 16 + 1 *

(alter all X"16's to +'s in this line)

+A +A +A +A +A

change/_+// 1 *

(change all occurrences of "_+" to null in this line)

AAAAA

Sinary of X)Tr The following table summarizes the subcommands that have Subsetc been presented in this chapter. When a subcommand can be abbreviated, its minimum abbreviation is shown in upper- case letters.

Function Subcommand

To create or edit a file XEDIT ((MS command)

To enter data Input

To control case setting SET CASE

To display file lines Type

To move the line pointer Down, Up TOP, Bottom

To move the column pointer CLocate, CFirst

To locate data CLocate

To make changes to the file Change, CInsert CDelete, CAppend

To recover deleted data RECover

To insert one line Input line ______-______To delete lines DELete

4-62 ------To replace a line Replace

*------To move lines MDve m.------To copy lines cOpy

m "- " ------To repeat a subcammand

" -.------.- To control special characters SET IMage _------. _--_------_--.--_ To define logical tabs SET TABS

.m. ------.-- To display tab settings Query TABS

------To display the logical record length Query LRecl

------To alter special character ALter .m------..... To end an editing session without QUIT saving the changes ------...------. ------.... To save automatically after changing SET AUtosave a specified number of lines

To save the changed file when you FILE have finished working on it

To store lines in temporary file for PUT subsequent imbed in another

To imbed a complete or a partial copy GET of one file in another

------

4-63 C3APTER 5: IBM 4341 MV/P aCMDN I hX F[BCILIfY

2 In chapter 2 you were introduced to the CP and CMS com- mand languages. A command language facility of CMS is the EXEC 2 facility. This facility, as an extension of the CMS command language is used through files which con- sist of sequences of statements or commands. These files are executed by the EXEC 2 processor. These files or procedures are referred to as "execs".

You may think of implementing this facility as program- ming using command language statements rather than FOR- TRAN. One "exec" command executes a series of job con- trol language statements.

When, during terminal sessions, you find yourself keying in the same sequence of commands over and over, you may place these commands in a CMS file. You may then invoke the command sequence by simply entering the filename on the terminal. The filetype of this file must be EXEC.

EXICFile The following is a list of the types of statements or StateMnts Or commands that you may use in an exec file. Ccmndi 1. CMS Commands

2. CP Commands - Must be prefixed by the word, CP.

3. Other EXECs - Must be prefixed by the word, EXEC.

4. EXEC 2 Control Statements - Starts with an EXEC 2 control word whose first character is an ampersand.

5. User Variable Assignments - Starts with an EXEC 2 variable whose first character is an ampersand.

6. EXEC 2 labels - Distinguished by the first character being a hypen.

7. Comments - Distinguished by the first nonblank char- acter being an asterisk.

Except for comments, the preceding statements are all ex- ecutable statements. An executable statement consists of a sequence of words. A word is a string of contiguous nonblank characters that is separated from other words by one or more blanks.

5-1 owiTO Create an EXBC 2 files are created the same way other files are, ~EX 2 File under control of the system editor, XEDIT, (Chapter 4). You will have to specify a filename, a filetype of EXEC, and, if a filemode is not given, Al is assigned by de- fault. To ensure that CMS calls the EXEC 2 interpreter to handle the files, the first statement in the files should start with the control word "&trace". Any filename can be assigned to an exec, even the names of other commands. In the VM/SP system, the order of search of names for execution is EXEC's on any disk in search order (A,B, C, ... ), modules on any disk, CMS commands, and then CP commcrands.

Using EZE 2 Chapter 2, "HOW TO GET STARTED", has shown you how to set Procedxres up a special procedure or exec known as the PROFILE EXEC. With this exec you can control such tasks as accessing commonly used macro and text libraries, linking and ac- cessing disks that are needed as part of the virtual machine configuration, and determining the characteris- tics of the terminal being used. As mentioned in that chapter, this exec is automatically executed at the be- ginning of a terminal session and can improve system per- formance and decrease keying workload.

The profile exec shown in Chapter 2 is repeated here to show the various types of statements used.

&TRACE GFF (EXEC 2 control statement) EXEC TTYPROF (another EXEC) CP LINK MAINT 318 318 RR (CP command) ACCESS 318 h (CMS command) GLOBAL MACLIB DMSSP CMSLIB SMACRD) OSMACRO1 TSOMAC (CMS command) ACCESS 192 b (CMS command)

EXC 2 USER

Variable Argments User variables play an important role in exec program- ming. You may define variables through the use of argu- ments or assignment statements. The example below of an exec 'cpyflA' illustrates defining variables by using ar- guments. The purpose of this exec is to link to the disk of another user and copy one of his FORTRAN files to your own disk.

5-2 Example CPYFLA

&TRACE * HIS EXEC WILL COPY A FILE FROM ANTHER USER'S A-DISK TO YOUR A-DISK. * THE ORIGINAL AND THE NEW FILE ARE OF FILETYPE FORTRAN. CP LINK &1 191 111 RR &2 ACCESS 111 F COPYFILE &3 FORTRAN F &4 FORTRAN A RELEASE F (DET

The exec, AcpyflA' is explained line by line in the next few paragraphs.

c&nIb& The &TRACE statement tells the system this file is to be processed by the EXEC 2 processor.

i*OoBents The asterisk at the start of a command line signals the line is a comment only and does not require processing.

(P LIK The CP command CP LINK &l 191 111 RR &2 is a cammand al- lowing you to link to another user"s disk and in this way obtain files from that disk. The &l and &2 are place holders for the variables to be inserted when the exec is processed. (The example below shows how to "call" the cpyflA exec with variables). The &l variable is the userid of the other user's disk which is at his address 191 and to made available to you at your address 111. &2 will be replaced by the read password of the other user's 191 disk when the command is executed.

ACESS ACCESS 111 F. This CMS command labels your 111 disk as your F disk. It will be searched after your A-E disks.

thF5IU3 COOPYFILE &3 FORTRAN F &4 FORTRAN A. This CMS command copies the FORTRAN program from the other user s A disk (which is linked to you and accessed as your F disk so that OOPYFILE is going to copy the program from your F disk) to your A disk. &3 will contain the name of the program as it appeared on the other user's disk. &4 will contain the new name that you give it. In other words the &3 and &4 are the Filenames. FORTRAN is the "file- type" for both files and the Filemode is F for the "old" file and A for the "new" file.

EEIKBY9E RELEASE F (DET . After the copy, you no longer need the F disk so you issue the CMS release command to free the accessed disk making these files no longer available. The (DET specifies the option that the disk is to be de- tached from your virtual machine; CMS calls the CP com- mand DETACH.

5-3 One might use this exec by keying the following:

cpyflA useraway read progaway prognew

The arguments to the exec are strictly positional. That is, the variable &l in the exec file takes on the real value of "useraway" (the userid whose disk will be linked to yours) because that is the first positional variable. Variable &2 takes on the value of "read" (the read pass- word of useraway's A minidisk). Variable &3 takes on the value of "progaway" (the filename of useraway's fortran file). &4 takes on the value of "prognew" (the filename of your new FORTRAN file).

VA M A&Z In the following example, the variable "&UNUSEDDISK" is assigned to the value "F". This variable is used in the following lines of the exec %cpyflBA as the filemode.

Example CPYFLB

&TRACE * ITHIS EXEC WILL COPY A FILE FROM ANOTHER USER'S A-DISK TO YOUR A-DISK. * IHE ORIGINAL AND THE NEW FILE ARE OF FILETYPE FORTRAN. CP LINK &l 191 111 RR B&F &2 &UNUSEDDISK = F ACCESS 111 &UNUSEDDISK COPYFILE &3 FORTRAN &UNUSEDDISK &4 FORTRAN A RELEASE &UNUSEDDISK (DET

Note that variables defined by assignment statements start with the ampersand (&) character. They may be up to 256 nonblank characters in total length. The maximum length of a line is also 256 characters. You may want to arbitrarily restrict the total length to that of about 10 characters.

E 2 cmRI---

ayi and "&trace", "&type", and "&print" are used to control the D15a bxj typing and displaying of information at the terminal.

I R&CE The &trace statement is necessary to invoke the EXEC 2 processor and may serve to display the exec acoimands as they are executed. It is also useful for displaying in- formation at the terminal during initial development of

5-4 an exec and during the debugging process. Several &trace statements may be scattered throughout the exec in order to vary the type and amount of information to be displayed.

The syntax of &TRACE is as follows:

&TRACE wordl

Where wordl may be:

ALL Command and control statements displayed as well as all non-zero return codes.

ON Each command and non-zero return codes are displayed.

ERR Non-zero return codes are displayed.

OFF Nothing is displayed. (or blank)

* Do not change the setting; equivalent to &TRACE with no arguments.

TEP, &SPINT The &type (or &print) statement is generally used to display user error messages or to prompt for information that is required by an exec. The syntax of &TYPE is as follows:

&TYPE [wordl [word2 ... ] ]

This will print at the console a line containing "wordl", "word2",.., separated from each other by a single blank, or print a blank line if no argumet is given. The line is truncated in CMS if its length exceeds 130.

InC FUNB The statements used to control flow within an exec are very powerful. The most frequently used control state- ments are described below. Notice the resemblence of many of these command words to those in FORTRAN.

&IF The syntax of the &if statement is:

&IF [wordl [word2 ...]]

The statement may be used to control logic flow within an exec. You might have the following: "&if wordl xx word2 executable statement" where xx may be eq, ne, lt, gt, le, or ge. If the condition is satisfied the given execut- able statement is executed; otherwise the next statement within the exec is processed.

5-5 SIC &rc is initialized to zero, and maintained as the return code from the last coramand (or subcommand) issued from the EXEC 2 file. It is quite often used as wordl in an "&if" statement. It remains zero if the previous command was successfully executed or set to nonzero if an error condition occurred. For example the following phrase might form a test condition.

&if &rc ne 0

UiDO'O The &goto statement syntax is:

&GOTO I line-number [comment] label

Transfer control to the given line number, or to the line starting with "label".

IMEAS Labels in EXEC 2 are formed by a hyphen followed immedi- ately by the label. For example "-end" might be a label to transfer control around other statements. See the ex- ample below.

&tr~T The &exit statement is used to stop execution of the exec and return control to the CMS environment. A numeric re- turn code may be used with this statement that will be displayed with the CMS ready message. The syntax of the &exit is:

&EXIT [return-code [comment]] [0] The default is 0.

The following example is of a complete exec. This is similar to the earlier 'cpyflN' examples, but in this exec you have the option of simply linking to another user's disk without doing a "copy", if only the userid and password is given. If the userid or password were incorrecly given the &exit command would display a "555" as the return code. Notice the "-end" is the control label in this example.

5-6 Example CPYFLC

&TRACE * THIS EXEC WILL COPY A FILE FROM ANMHER USER'S A-DISK TO YOUR A-DISK. * THE ORIGINAL AND THE NEW FILE ARE OF FILETYPE FORTRAN. CP LINK &1 191 111 RR &2 * MAYBE THE USERID OR PASSWORD WERE WRONG AND THE &RC IS NOT ZERO. &IF &RC NE 0 &EXIT 555 ACCESS 111 F * MAYBE YOU JUST WANT TO LINK AND N5T COPY. &IF X&5 NE XCOPY &GOIO -END COPYFILE &3 FORTRAN F &4 FORTRAN A RELEASE F (DET -END

To use this exec to "link" only, key in the following:

cpyflC useraway read

To use this exec to "copy", key in the following:

cpyflC useraway read programaway programnew copy

The syntax of the &loop statement is:

&LOOP n m label * WHILE condition UNTIL

Loop through the following "n" lines, or down to (and including) the first line starting with "label", for "m" times, or indefinitely (*), or "WHILE" (or UNTIL") the given condition is satisfied.

The values of "n" and "m" (if given) must be numeric; also "n" must be positive, and "m" must not be negative.

The form of the condition (if given) is similar to that of the &IF statement previously described.

The following example illustrates the &loop statement, using the "until" condition. In this example the loop is set up to enable the user to copy more than one file from another user's disk. In this case three files are copied.

5-7 Example CPYFLD

&TRACE * THIS EXEC WILL COPY FILES FROM ATIHER USER'S A-DISK TO YOUR A-DISK. * THE ORIGINAL AND TEHE NEW FILES ARE OF FILETYPE FORTRAN. CP LINK &1 191 111 RR &2 ACCESS 111 F &NUM = 1 &LOOP -ENDCOPY UNTIL &NUM GT 3 COPYFILE FILE&NUM FORTRAN F MYFILE&NUM FORTRAN A &NUM = &NUM + 1 -ENDCOPY RELEASE F (DET

To use this exec key in the following:

cpyflD useraway read

This exec will now take useraway's filenames of fileA, fileB, and fileC and copy them to your own disk with the filenames of myfileA, myfileB, and myfileC.

&SK][P The syntax of the &skip control statement is:

&SKIP n [comment] 1

The default is 1.

This control statement permits a branch to be made around a specified number of lines without requiring the use of an EXEC 2 label as the "&GOTO" did. If n equals -1, then the control is transferred to the line immediately preceding the statement. If n equals 0, then the control is transferred to the next line after the statement. INTE: This means that if n equals 1, control is transferred to the SECOND line following the "&skip". If -n causes transfer of control to precede the start of the exec, then execution stops abnormally with an error mes- sage. If n is large enough to cause transfer of control past the end of the exec, then execution stops, normally with a return code of zero.

5-8 INTH»CVE D PASSINE

To enter data to an exec interactively the &read state- ment is used. The syntax of this statement is:

&READ n 1 * ARGS STRING var VAR[s] [varl [var2 ...]]

When this command is processed it causes a "read" from the stack (if the stack is not empty) or a read from the console and execute or assign what is read according to the following rules. For our purposes we will assume an empty stack.

If "nn , 1" or "*" is used, read "n" lines, or read an indefinite number of lines (*), and execute them indivi- dually as if they had been part of your EXEC 2 file. The default value is 1.

With "ARGS" you would key in a single line and the words in it would be assigned to the EXEC 2 arguments &1, &2..., and any other EXEC 2 arguments previously set would be discarded.

If you wish to replace the variables in an exec you would use "VARS" and a single line is read; the words in it are assigned to the variables "varl", "var2"...If the number of words in the line read exceeds the number of variables given in the statement, the surplus words are discarded; or if the number of variables exceeds the number of words, the remaining variables are set to the null string. Therefore "&READ VARS" (without any variables) can be used to read a line and discard it. Asterisks may be used inlieu of variable names to indicate that the corresponding words in the line read are to be discarded.

Dbte in the next example you might have invoked the com- mand by typing only:

cpyflE

then, when the &READ ARGS &1 &2 &3 ... command is pro- cessed, you would type in the line as prompted by the &TYPE statement:

useraway read progaway prognew

5-9 which contains the argument list. The next time you would interactively pass data is when the second &TYPE statement would prompt you that the &READ VARS &UNUSED- DISK command expects you to type the filemode of an unused disk that you wanted to link to the other user's disk. So you might type "F" if you knew you were not using an "F" disk.

Example CPYFLE

&TRACE * THIS EXEC WILL COPY A FILE FROM ANCTHER USER'S A-DISK TO YOUR A-DISK. * THE ORIGINAL AND THE NEW FILE ARE OF FILETYPE FORTRAN. &TYPE NOW IS THE TIME TO KEY THE USERID,PASSWORD,AND OLD AND NEW FILENAMES &READ ARGS &1 &2 &3 &4 CP LINK &l 191 111 RR B&F &2 &TYPE NOW IS THE TIME TO KEY THE UNUSED DISK SPECIFIER. &READ VARS &UNUSEDDISK ACCESS 111 &UNUSEDDISK COPYFILE &3 FORTRAN &UNUSEDDISK &4 FORTRAN A RELEASE &UNUSEDDISK (DET

Sj c I E &

The CMS EXEC You can create a special exec, the CMS EXEC, by using the CMS list file command. For example, by keying "listfile * listing a (exec" where 'listfile" is the CMS command to list information about CMS files, '*' is the character used to list all filenames with the following filetype and filemode, 'listing' is the filetype of interest, 'a* is the filemode of interest. The '(exec' is the option which causes the CMS- EXEC to be created. Without it, the command would be executed but no exec would be created. The command given above is an example command line; the filenames, filetypes, and filemodes may differ. "list- file" and "(exec" are necessary in order to create a CMS EXEC; they may not be removed or changed. The command

listfile * listing a

might result in the following display:

PRGRAMl LISTING Al PROGRAM2 LISTING Al PROGRAM3 LISTING Al

Typing "type cns exec" will display the following if the

5-10 above listfile command is issued with the (EXEC OPTION :

listfile * listing a (EXEC

&l &2 PROGRAM1 LISTING Al &l &2 PROGRAM2 LISTING Al &l &2 PROGRAM3 LISTING Al

Notice that this CMS EXEC contains the file identifiers of all files selected with the "listfile" command. They are preceded by variables that may be defined later by the use of arguments to the CMS EXEC. For example, one could use the first argument by keying "cms erase" and setting up a chain to clear a minidisk of files that are no longer wanted. For example:

cms erase ERASE PROGRAM1 LISTING Al ERASE PROGRAM2 LISTING Al ERASE PROGRAM3 LISTING A1

Since a second argument is not provided in this example, &2 is considered null and is disregarded in this pro- cedure. One could use the second argument, for example, and key "cms disk dump" and get DISK DUMP in front of each of the files in the exec. rjajL'rjI R In chapter 2 you were introduced to the PROFILE EXEC. In the same manner you can change or add to the system de- fault editor. A PROFILE XEDIT has been set up for you with default values. But as you become more familiar with the system you may want to change some of these values. The "set" command is used to establish, turn off, or reset a particular XEDIT function. Only one function may be specified per SET command. To determine or verify the setting of a function, use the QUERY com- mand from within XEDIT.

At this printing a limited number of NCAR execs have been written and tested. The advantage of "in-house" execs is that they are designed to be of particular use on our system. Some of these are listed here and complete docu- mentation for them is contained in appendix B and on-line as "HELP" files.

5-11 LINKTO userid [VIRTADDR1 [VRTADDR2 [FILEMODE]]]

This commnand allows you to link to and access anothers disks. You must specify who it is that owns the disk you are trying to access, and you may optionally specify which of his disks you wish to link to yours, what address you wish to have assigned to it and with which filemode. The userid of the other user is the only required argument.

YMDWTr MOUNT tapenum virtaddr trk den in/out

The mount command requests a tape mount for a user. The request is repeated automatically until specifically can- celled by the user or by the operator. Tapenum is the VSN (tape number) of the physical tape to be mounted. Virtaddr is the address of your "tape" (181, 182, 183 or 184). Trk, den and in/out refer to track, density and whether the "write" ring is to be left in or out.

Deta±ch When you have finished using the tape it is important to "detach" it. To do this issue the command:

detach virtaddr

Cancel To cancel a pending mount request issue the command:

mount cancel tapenum

To find out what "mounts" you have pending issue the com- mand:

mount query

Nessge To send a message to the operators issue the "mount" com- mand with a dummy tape number 000 as follows:

mount 000 181 *important message:

PNASGaUD This ccrmand allows you to change your "logon" password. When you enter this command, the system will prompt you for your new password and then ask you to enter your old password for purposes of validation.

PASSWORD

HracmNiS This conrrand sends to the printer all that has been list- ed on your terminal since a "SAVTERM" command has been issued. (See SAVTERM)

PRTTEIRM

5-12 SAVIE™ This command 'saves' your "console' listings so that you can have a hard copy of everything that gets entered at your terminal, until you issue the "prtterm" command. A beginning user is urged to "save" his console commands. This makes it much easier to determine where you went as- tray if you become confused during a terminal session. Thus, you can get a transcript of your entire terminal session or by issuing a sequence of "savterm", "prtterm" commands you could get specified selections from the ses- sion (see PRITERM).

SAVTERM

ST1RUGE This command allows you to increase the virtual memory size of your virtual machine.

STORAGE size

Where size is measured either in kilo- (thousand) or mega- (million) bytes of memory. For kilo-bytes the specification is "nnnK" and for mega-btyes it is "nnM". Your default memory size is 512K bytes of memory. If you issue the command:

storage 1M

you will have doubled your virtual memory. After this command you will need to IPLCMS again.

EBMPDISX This command gets a temporary disk and formats it. The virtual address assigned to the temporary disk will be the first available address at 500 or above, and the mode will be the first mode available to your virtual machine.

TEMPDISK size

where size is the number of 512 byte blocks for the tem- porary disk. The maximum value for size is 20000. To find out whether this has been accomplished and what the disk mode is issue the command:

query disk *

One line is displayed for each accessed CMS disk.

53{yR:ES The following IBM manuals and references may be used in support of the information given in this chapter.

5-13 SC24-5219 %5/SP Exec 2 Reference SC24-5221 VM/SP Editor Command and Macro Reference SC19-6204 VM/SP System Messages and Codes SC19-6209 W4/SP CMS Command and Macro Reference SC19-6210 VM/SP CMS User's Guide SC19-6211 VM/SP CP Commrand Reference for General Users

5-14 RUMVa 6: 1JUBLLN AMD IvBDIE JCBS cm ]HM 4341

]/[i ADLuiUM This chapter presents the methodology for running and de- bugging jobs on the IBM 4341 using FORTRAN. Those things to be typed by the user are in lower case letters and system responses are in upper case letters.

F]IE l)-XAND The normal residence of FORTRAN source code which is to CEoKST BY E be compiled on the 4341 is assumed to be the 4341 disks. PRTAN PROCESS As such, the file must have a legitimate filename (1-8 alphanumerics, the first of which must be alphabetic, with neither special characters nor embedded blanks per- mitted). The filetype must be FORTRAN. Further require- ments are that the character set be EBCDIC, the record format be fixed (F), and the record length be 80 charac- ters. Files created on the 4341 with filetype of FORTRAN will conform to these requirements, other files may need to be made to conform by methods described in a later section of this chapter.

The output of the compiler goes into a file having the same filename as the FORTRAN file, but a filetype of TEXT. The TEXT file is used as input to the loader. This file will be created on the same disk on which the FORTRAN file resides. The creation of this file may be suppressed by using the NOLOAD option on the FORTVS statement.

The listing that is generated by the compiler is stored in a file having the same filename as the FORTRAN file but a filetype of LISTING. This will also reside on the same disk as the FORTRAN program.

Before running even the most simple FORTRAN program, the appropriate libraries to be searched...by the LOAD state- ment must be identified. These have been set up as glo- bal macro statements in the exec (FORTVS) you use to com- pile your program.

The commands to compile and load a program only allow the filename to be specified. The filetype has been taken care of by insisting that it be FORTRAN. The filemode uses the default search order for the disks. This is al- phabetical (i.e., A, then B, then C etc). The first oc- currence of the required file will be used. This means that if you have several versions of a program residing on different disks, it is up to you to manipulate them so that the appropriate version will be encountered first. This may be done by accessing the disks in the appropri- ate order or using the RENAME command which is described in the CMS Command and Macro Reference (SC19-6209-0) and Appendix A of this publication.

6-1 Space for the generated files must exist on the same disk on which the input file resides. If your FORTRAN pro- gram exists on your A disk, then the A disk must have room for the TEXT and LISTING files. If there is not enough space error messages will result. If this occurs, you must delete some files on that disk or move the FOR- TRAN file to another disk which has room for the output files. To compile FORTRAN on the IBM you must have a minimum machine memory of 2 megabytes (see Chapter 2).

1iNGA SIA SE The most simple FORTRAN job that can be run on the IBM is kIOasNs JOB stored on an IBM virtual disk, the input to be read is typed in at the terminal and the output to be printed is sent to the terminal. The example in this section demon- strates the compilation, loading and execution of a FOR- TRAN program having filename AREA, filetype FORTRAN and filemode A. This program reads the length and width of a rectangle from the terminal and prints the computed area to the terminal. The program may be seen to the right of the terminal commands.

terminal commands listing of area fortran a

fortvs area REAL LENGTH,WIDTH ,AREA R; T=0.05/0.07 13:12:34N WRITE (6,1) load area 1 FORMAT (A INPUT LENGTH') R; T=0.03/.03 13:13:01N READ (5,*) LENGTH start WRITE (6,3) INPUT LENGTH 3 FORMAT (" INPUT WIDIH") READ (5,*) WIDTH 10.0 AREA = LENGTH * WIDTH INPUT WIDTH WRITE (6,4) AREA 4 FORMAT (" AREA = r,F10.2) 20.0 STOP AREA = 200.00 END R; T=-0.12/0.13 13:30:51N

Ilstato -4 The instruction given to compile a FORTRAN program is "fortvs filename". FORTVS is an exec used to compile ei- ther FORTRAN 66 or FORTRAN 77 compatible code. The de- fault is for FORTRAN 77 code. All options for the FORTVS statement may be found in the VS FORTRAN Application Pro- gramming: System Services Reference Supplement (SC26- 3988-0). The default values for options of special in- terest are that error messages and compiler statistics are written to the terminal, a TEXT file is created on an available disk and the source code is listed in the LIST- ING file. If any of these defaults are to be changed, the appropriate keyword is included in parenthesis behind

6-2 the filename. For example, "fortvs area (langlvl(66)" would be used to specify that the program is to be com- piled using FORTRAN 66. Notice that the final parentheses is optional and has been omitted in this ex- ample. If more than one option is given, they are separated by blanks.

Cpilati Error When the compilation is complete, a line is printed by Fesoages the system which begins with "R;" or "R(x);". If there were no compilation errors, the first of these is re- turned, otherwise x is the highest severity level of the error messages which were generated. The meaning of x is as follows:

00000 No errors were generated but informational messages may exist. If a message exists, check your results. 00004 Warning, possible errors were detected. Execution should be successful but results should be checked carefully. 00008 Errors were detected. Compilation will continue but execution may be prohibited. 00012 Severe compilation errors were detected. Compilation may continue but execution is prohibited. 00016 Errors were extremely severe. Compilation will be terminated.

The "load" statement is used to load the TEXT file. It Stat$eent has the form "load filename[ filename...] (options)". The options available on the load statement are found in the "CMS Command and Macro Reference Manual" (SC19-6209- 0). For initial use, the default parameters will suf- fice.

CntiminoigRv a L ID When a program has more separate TEXT files to be loaded Stasteinn than can be fit onto a single statement, the INCLUDE statement should be used after the first LOAD statement. The LOAD command causes the loader tables to be initial- ized which effectively cancels the previous LOAD state- ment. The INCLUDE statement has the same form as the LOAD statement and is discussed in the same section of the CMS Ccmmand and Macro Reference manual.

You must include on a LOAD or INCLUDE statement all TEXT files needed by the program which are not automatically identifiable by the loader. A file is automatically identifiable if its filename is the name of a program unit and that program unit is referenced external to the file in which it resides.

6-3 If duplicate TEXT files are found, the first one encoun- tered is the one that is loaded.

To begin execution, the "start" command is used. It is documented in the CMS Command and Reference manual (SC19-6209-0) and for our purposes will have no argu- ments.

Programs that take input from the terminal should print statements associated with each read identifying the field to be read. When list-directed I/O is used, as in the example above, the system will display a question mark to indicate that the program is waiting for user response. If formatted reads are used, these statements should also print the appropriate format specification. When the read is under format control, the system will not display the question mark and there is no warning other than the statements printed by the program to warn the user that the program is waiting for input.

If you were to list all files on your A disk after exe- cuting the above FORTRAN program the disk would contain, at a minimum, the following files:

listf AREA FORTRAN A AREA LISTING A AREA TEXT A R; T=0.04/0.06 13:48:06N

UJM- -FILE This section deals with how to change three aspects of a FORTRAN file, so that the FORTVS compiler will accept it.

BOM to IRBMIC If you have a file on the IBM which was created for use on the 7600 and you had that deck read into the IBM card reader, you need to perform this conversion. To change the characterset you can use copyfile with the option "eb". The new file will be in the correct characterset. The command needed is:

copyfile oldname fortran a newname fortran a (eb P--- Files staged across the network arrive at the IBM with a variable record format rather than a fixed record format. There are several ways to change this but one very simple way is to XEDIT the file and before filing the file, is- sue a SET RECFM command. This command has the form:

6-4 set recfm f

CManging t It is not always necessary to change the logical record length, but in case you do need it it can be done with L ih the SET LRECL command inside of XEDIT. The command is:

set irecl 80

This section will contain some additional features of FORTRAN programming that may be found on the IBM 4341 under CMS. Each subject will have a separate section ti- tled appropriately.

Free-foi Fartran FORTVS supports FORTRAN where source statements do not have to begin in or after column 7. The option on the fortvs statement which indicates the file is free-form is "free" as in:

fortvs filename (free

Using FilE The FILEDEF command, as it is needed for execution-time files, is discussed in this section. It is used to re- direct output so that the terminal, or the virtual punch, is not the only source of input and output available to your program. It is also used to define units other than standard input, standard output and the punch unit. Unit numbers may range from 1 to 99. The only FILEDEFs for which options are included in this discussion is for phy- sical tape. Options are available for other forms of the FILEDEF. The FILEDEF command is discussed fully in the CMS Command and Macro Reference (SC19-6209-0). Any filedef commands needed by your program should be typed before the "load" ( or "start") command is given. They should not preceed the "fortvs" statements as the filedef tables are cleared when a compilation is done.

The filedef needed to define a unit as being a virtual device other than a disk or a tape is of the form "filedef xx device". "xx" is the unit number and "dev- ice" may be the terminal, the reader, the punch or the printer. One often used example of this type of filedef is to reassign unit 6, standard output, to go to the line printer. To do this requires the following filedef.

filedef 6 printer

To define any unit, including standard input, as a file residing on one of your virtual disks, you need a filedef of the form "filedef xx disk filename filetype filemode". "xx" is the unit number, therefore to change unit 5, standard input, from the terminal to the file CARDS DATA A would require the following filedef.

6-5 filedef 5 disk cards data a

Sometimes, you know before executing a program that you are not interested in seeing the output generated on a certain file. Rather than produce the output and never examine it, or modify the program so that the file is not produced, you can indicate with a filedef command that no real I/O is to be performed. The necessary command is given below for unit 8.

filedef 8 dummy

The filedef command used to read a physical tape is of the form "filedef xx tap{n} (options)". "xx" is the unit number and n is the indicator which corresponds to your virtual drive. "n" may be from 1 to 4 representing vir- tual drives 181 to 184. The options identify the charac- teristics of the physical tape, i.e., the number of tracks, the density, and blocking information. The options and a brief definition are given below: nTRACK specify n as 7 or 9 depending on the number of tracks TRTCH a a is a code specifying parity, converter and translator settings (see the manual if you need to use this option) DEN n n represents the density and may be 200,556,800,1600 or 6250. RECFM a a indicates the record format and may be F (fixed-length records) FB (fixed-length, blocked records) V (variable-length records) VB (variable-length, blocked records) U (undefined-length records) FS (fixed-length, standard blocked records) FBS (fixed-length, blocked, standard blocked records) VS (variable-length, spanned records) VBS (variable-length, blocked, spanned records) LRECL n n is the length in bytes of the logical record (default=80) n is the actual record length if the records are fixed-length n is the length of the largest record if the records are variable length n is omitted if the records are undefined-length BLOCK n n is the length in bytes of the physical record (default=80) n is the same as LRBCL if RECFM is F or FS n is a multiple of LRECL if RECFM is FB or FBS n is LRECL+4 if RECFM is V or VS n is a multiple of LRECL+4 plus 4 more if RECFM is VB or VBS n is the greatest amount of space required to hold all of the records that are to be grouped together if RECFM is U

6-6 The complete filedef needed to read a 9-track, 1600 BPI tape containing card images of a FORTRAN program where each card image is also a physical record is given below. The tape is mounted on your virtual drive 181. filedef 8 tapl (9track den 1600 recfm f lrecl 80 block 80)

If the records were blocked so that 10 card images formed a single physical record, the complete filedef would be filedef 8 tapl (9track den 1600 recfm fb lrecl 80 block 800)

aMunting a Before you use a tape, it must be mounted on a physical Physical Tape drive which is attached to your virtual drive. The com- mand to mount a tape is of the form "mount tapeid viradd track dens ring". Tapeid is the name of the volume, viradd is the virtual address of the your drive (181 to 184), track is the number of -tracks, dens is the density and ring indicates whether or not a write may be issued to the tape. The value of ring is "in" if a write may occur and "out" if the tape is read only.

The mount command will produce two messages on your ter- minal. The first, MOUNT ACCEPTED, tells you that your request has been transmitted to the operator console. The second message, TAPE 18n ATTACHED, is the one that tells you that your tape has been mounted.

When you are finished using the tape, you should detach your virtual tape drive with a "detach 18n" command; the system response is TAPE 18n DETACHED. The entire se- quence of mounting and dismounting a physical tape, Bxxxxx, from your 182 drive is given below.

mount Bxxxxx 182 9 1600 out MOUNT ACCEPTED : Bxxxxx AS 182 AT 16:07:04 07/20/81 R; T=... TAPE 182 ATTACHED [ tape used here ] detach 182 TAPE 182 DETACHED R; T=...

6-7 Gettirg Your If you have a program or data that is on a physical tape Progra ito Yo and you wish to transfer it to your minidisk, you will Disk Ftca Tape first need to ask the operations staff to mount your tape on a physical drive. Use the mount command presented above. For the remainder of this discussion, assume that virtual tape drive 181 is the one you have chosen to use.

Once the tape has been mounted on a physical drive, you must give 2 FILEDEF commands, one describing the input tape and one describing the disk file to be used as the output file. The MOVEFILE command is used to move the input file to the output file. Multiple files on the in- put tape may be copied to different disk files by repeat- ing this sequence of commands.

The commands needed to copy the first two files of Bxxxxx to disk files FILE1 FORTRAN A and FILE2 DATA A are given below. The assumption is that the card images are not blocked. After the files have been copied, be sure to detach the tape from the virtual drive.

filedef inmove tapl (9track den 1600 recfm f lrecl 80 block 80) filedef outmov disk filel fortran a (recfm fbs lrecl 80 block 80) movefile inmove outmov filedef inmove tapl (9track den 1600 recfm f lrecl 80 block 80) filedef outmov disk file2 data a (recfm fbs lrecl 80 block 80) movefile inmove outmov

Getting Your Assuming that you have a program, or data on cards, that Progrm cnto Your you would like to store on your virtual disk, you will Disk From Cards need to preceed the deck with an ID card. This card be- gins in column 1 with the keyword ID. In column 10, you put your logon id. Mark the deck "IBM-4341" and give it to the operations staff. This deck is then read in by the computer operations staff and it will appear on your virtual card reader. If you are logged on, when the file is transferred, a message will appear on your terminal; if not, the message will not be repeated. Issuing the command "query reader all" will tell you how many files are in your virtual card reader.

Now you must move those files to your minidisk. To do this, type the command "rdr". The system will prompt you as to whether you wish to save or purge each deck in your reader. You may either give the complete file iden- tifier or type "purge". If you do not know the order of the decks in your reader, it may be necessary to use the CMS RENAME comnand on them. See the section in Appendix A, "Other Useful CMS Commnands" for the format of RENAME.

6-8 Creating ai E3HC The chapter on execs, chapter 5 (section II), in this foar Frequenly Run guide explains how to create exec files. It should be read for detailed information. You might find that you wish to create special execs for some of your programs that require several 'filedef' or 'include" statements. This can be especially useful during the debug stage when you are compiling, loading and executing the program several times in rapid succession. Rather than spending time to create a general purpose exec that will handle all possibilities for all programs, you may create a very specific exec with the same filename as the program but with filetype of EXEC. Then you will only have to type the name of the exec and any terminal input needed for each test run.

Creating and Using Once a program is completely debugged and ready to be an Absolute Binary used as a production program on the IBM, it may save sig- Module nificant time to create an absolute binary module of it. This process is known as "genmod" (GENerate MODule) on the IBM. It is documented in the CMS Command and Macro Reference manual (SC19-6209-0). To create the module, first load the object program into virtual memory. The module file of the loaded program can then be created by "genmod modulename (options)". The file that is created will have the filename "modulename", filetype of MDDULE and filemode A, i.e., it will reside on your A disk. An example of loading a FORTRAN program named AREA and creating a module with the name RECTANGL is given here.

load area R; genmod rectangl R;

I . . - . . . - - - - When you wish to use this nonrelocatable module, first give any FILEDEFs used by the program. The only step necessary to execute the module is to give its filename as a CMS command as in the following example.

filedef 6 printer R; rectangi R;

Badtd FRI in The CMS batch facility is discussed in the CMS User's OCS Guide (SC19-6210-09). This facility is convenient when you have a job that will take a long time to compile or execute and you wish to use your terminal for another purpose while that is happening. Essentially several

6-9 virtual machines have been set up and are under the con- trol of a batch 'monitor". The batch monitor routes jobs to the various batch working machines. Currently there are no restrictions as to which job may be sent to which machine due to job characteristics. NOTE: Due to errors in the batch monitor, this facility is not available as of this printing.

IFTRAN is easy to use on the IBM. An EXEC file for doing so has been written and resides on the FORTRAN tools disk (318) and is named IFTRAN. This disk is automatically accessed by the PROFILE EXEC which is described in chapter 2 of this guide. The filetype of the input file should be IFTRAN. When the IFTRAN is processed, a FOR- TRAN file of the same filename will be created. You may then compile the FORTRAN file, load the TEXT file and start the job. The listing of the IFTRAN will be placed in a file of the same name but with filetype IFLIST. The only statement needed which has not been used previously is

iftran filename

im w An assembler file must have filetype of ASSEMBLE. To cause the routine to assemble, you type "assemble filename". There are two types of assembler language programs, the first type (lowest level) does not call another subprogram; the second type (highest level) does call another subprogram. The linkage instructions for these two types of assembler codes are contained in the VS FORTRAN Application Programming: Guide manual (SC26- 3985-1). Some other considerations for ASSEMBLER pro- gramming are discussed in that manual, but an IBM ASSEM- BLER Reference manual will be needed to learn the in- struction set (any of the Principles of Operations manu- als will serve this function). OS/VS-VM/370 Assembler Programmers Guide (GC33-4021-3) and the Reference Summary Card (GX20-1850) will also be useful for ASSEMBLER language programming.

E711fa S ON 'RE There are several debugging aids on the IBM. The most INM 4341 interesting to the FORTRAN programmer is a FORTRAN in- teractive debug facility and it will be presented in some detail.

This facility makes debugging a FORTRAN program very sim- Interacive Deug ple. You may stop your program during execution at specified breakpoints and ask to see the values assigned to given variables. If you wish, you may reset a vari- able and proceed from that point (or any other point). When a breakpoint occurs, you are in charge of the system and may issue any of the possible subcommands.

6-10 All of the libraries required by TESTFORT are automati- cally referenced by the FORTVS EXEC. The NCAR user is not required to keep track of this information. In order to use this debugging tool you must use the TEST option on the FORTVS statement, i.e. "fortvs area (test)". It is also required that the file(s) to be used with TEST- FORT, must be serialized; this may be done by two can- mands within XEDIT. They are given below:

set trunc 72 set serial all 1 1

The statement which causes loading and execution of the debug module is not the LOAD statement but the TESTFORT statement. FITEDEFs needed by the program must be given before the TESTFORT command. The FORTRAN Interactive Debug for OS(TSO) and VM/370(CMS) Terminal User's Guide (SC28-6885-2) and Reference Card (SX28-8193-0) are the references for this tool.

To use this facility, you should have a current listing of the source code which shows the sequence numbers for each line of code. Any sequence number or any statement number within the program may be used as a breakpoint. To indicate that a breakpoint refers to a statement number as opposed to a sequence number, preceed all statement numbers with a "/". Statement number 75 is designated "/75" while sequence number 75 is "75".

The beginning of a FORTRAN Interactive Debug session is Sessiomn shown below.

fortvs myprog (test) R; testfort myprog TESTFORT at /10 go

rvil- - -AFM - JL-- r- -- T --V- -f ------'I . - ---. . - -. . The 'AT' Statement 'ne AT statement is used to establish breakpoints. "AT /10" in the previous example causes the program to inter- rupt when statement number 10 is reached. This statement has not yet been executed when control is passed from the program to you. More than one breakpoint can be given in a single AT command by putting them within parentheses and separating them by commas. To give a range of line numbers stopping at each one, give the starting number and ending number separated by a colon. The command "at (10,/30,/40,70:80)" would cause breakpoints at sequence numbers 10 and 70 through 80 as well as statement numbers 30 and 40.

6-11 It is possible to stop at a given statement number or line number only at given iterations. To do this add the COUNT option to the AT subcommand, i.e. "at 100 count (10)". This would cause a breakpoint at line number 100 every 10th time it was executed. This option is useful for limiting printout inside of FORTRAN loops.

The ALIST" One form of displaying variables is through the LIST sub- Subcommand comrand. To display a single variable B use, "list b". To display multiple variables use the form,"list (a,b,c,d)". To display elements of an array, use "list arry(l):arry(10)". If the listing is very long, you may wish to use the PRINT option. This option causes the display to be printed rather than have the listing go to the terminal. To invoke this option, use "list arry(l,l,l):arry(10,14,60) print".

The "SET" To reset a value which is incorrect, use the SET subcom- Subcommand mand as in "set a=l.0" or "set arry(2,3,8)=10.456".

The "TRACE" A TRACE subcommand exists which may be used to monitor Subcommand branches to subroutines or to monitor all branches in the program (IFs, GO TOs etc). To monitor only branches to other routines, use "trace entry". The system might respond "TRACE: SUB1 ENTERED AT ENTRY1". To monitor all branches, use "trace stmt". The output from this subcom- mand might look like "TRACE: FROM 150/20 TO 210/40". Note that both the line number and the statement number are given as part of the TRACE output. The ALISTBRKS LISTBRKS may be used to monitor all breakpoints which Subcommand have been set to the point when that command is issued.

The "GO" When you are ready to proceed to the next breakpoint, be Subcommand sure that one exists (use the AT command to create one if necessary) and then type "go". To resume execution at a specific point in the program, like statement number 100, use "go /100".

The "RUN" and If you wish to continue execution but allow no more de- "END" Subconmands bugging breaks, use the "run" command. Once the program has terminated, the system is not out of the testfort mode but is ready to begin another iteration. Use the "end" command to terminate the session and return to CMS.

Other Subcomnands This is not a complete discussion of the FORTRAN Interac- tive Debug facility. All of the possible subcommands have not even been mentioned. It is a useful subset which allows you to use the facility. You may add other subcxrnands as you need them, by reading the FORTRAN In- teractive Debug User's Guide (SC28-6885-2).

6-12 Getting Out of In the course of using TESTFORT, the errors that you Hopeless create sometimes seem to leave you in a place where you Entanglements are unable to get back the TESTFORT prompt. For in- stance, TESTFORT keeps telling you to RE-ENTER and every- thing you enter only returns the same message, RE-ENTER. At this point, what you need to do is strike the "PAl key" twice. This will bring back the TESTFORT prompt and you may start from scratch entering the next subcommand. The PAl key at NCAR may be a series of key strokes, please see the keyboard layout for your terminal to determine the correct series. These are found in Appen- dix C.

Other Duggids The chapter entitled "HOW VM/SP CAN HELP YOU DEBUG YOUR Aids FORTRAN PROGRAMS" which is found in the CMS User's Guide (SC19-6210-0) presents a variety of tools available through CMS and CP. These include such topics as the CMS DEBUG command and core dumps. It is advisable to read through this chapter so that you will be familiar with the tools that do exist.

In this section you will find some warnings about the BWSSEN; FORTVS compiler.

1. The order of certain non-executable statements is of importance. In the following sequence, the INTEGER statement may not follow the REAL statement. In the event that they are not in the "proper" order, a $ will appear under the "c" of nxc and nyc, and under the "f" of nxf and nyf and the message ORDER will appear 4 times.

subroutine xyz(uc,nxc,nyc,uf,nxf,nyf) integer nxc,nyc ,nxf ,nyf real uc(nxc,nyc) ,uf(nxf,xyf)

2. Format statements require commas between fields. Statements such as the following will not compile. A comma must separate the characters ' and 5.

100 format (' gradient'5 (3X,F15.6)

3. A literal string cannot be used directly in a logi- cal IF test. The following example will yield a SYNTAX compiler error. The 1H* will have to be stored as a variable for the test to compile.

IF (ISTAR.NE.1H*) PRINT 100, ISTAR

4. Using the ERR= parameter on the READ statement I causes a branch to be taken to another statement if an error is encountered. The data is not made available to your program unless a second READ is

6-13 done.

5. An abend (abnormal end) will occur if your program inputs an empty line from the terminal and a rewind is not executed before attempting another read.

6. Although default FILEDEFs exist for all FORTRAN units, you cannot successfully override the default LRECL attribute unless you specify the BLOCK parame- ter as well. (Even if the RECFM is F!)

7. Output going to the terminal from unit 6 defaults to a logical record size of 80 characters rather than the 133 that is more common for standard output. Therefore, you may find that you need to use the RECFM and BLOCK parameters on FILEDEFs referring to devices other than physical tape. The message you will get when the FILEDEF does not provide a large enough record size is

FORMATTED I/O, END OF RECORD, FILE FTxxF001

8. If you are compiling some of your programs with language level 66 and some with language level 77, you may find that it is best to recompile each time you wish to load a program. Certain utilities on the IBM have different versions for these language levels and the version you receive depends on your "latest" compilation rather than on the specific compilation which is calling the utility.

(ERRoRMESSAGS Errors produced by CMS and CP may be found in the System Messages and Codes manual (SC19-6204-0). The system abend codes may also be found in that manual. All FORTRAN exe- cution messages are given in the VS FORTRAN Application Programming: Library Reference manual.

Bw 1SD SBHET A The following method should allow you to run a job on the JXNB TO T CDC CDC 7600 from the IBM 4341 and have the output return to 7600 your virtual card reader.

Using XEDIT described in chapter 4 build a file which in- cludes your source code and data and the necessary 7600 Monitor Control Cards. A file with filename J76SEND with filetype JOB might look like this:

6-14 *JOB, ssss, pppppppp,name *DISPOSE,DN=PR,MF=IO, DC=BO *FORTRAN ,FL source code *RUN,I *END

*DISOSE The *DISPOSE card will cause your printout to be returned - to the 4341 and be placed in your virtual card reader. It will be tagged with the NETWORK sequence (seqn) number associated with the 7600 run. The user may retrieve the printfile and store it into a CMS file by entering the CMS command:

DISK LOAD

The filename will be OTPTXXXX (OTPTXXXX generated by the network). The filetype will be IOSSSS (IOSSSS is the 7600 sequence number).

7600JOB To submit the above file to the CDC 7600 you may use an NCAR exec called 7600JOB. Just enter:

7600job j76send job

For more information on moving jobs around the network, please see Section V of this User's Guide.

IfhITIIKCA X33 TOCW- K 2EIEK

CKIYJBI To submit a job directly to the CRAY-1 from a disk file on the 4341 you may use the NCAR exec CRAYJOB. The file to be shipped must contain the CRAY JCL needed to execute the job. Assuming that the name of the file is CRAYJCL enter:

crayjob crayjcl

The first file found with filename CRAYJCL and filetype JOB would be shipped to the CRAY. The $OUT file is automatically sent back to your virtual card reader. To retrieve the printfile and write it as a print file on your A disk enter:

disk load

For more information on moving jobs around the network, please see Section V of this User's Guide.

6-15 AP IX A IBM Commands

SECTION II Interactive Computing on the IBM 4341 APPENDIX A

DL n a nim;:w - wvFlrwg Use the DISCXNN command to disconnect your terminal from Youzr Tii the VM/SP system while the virtual machine continues operation. The terminal remains disconnected until it is reconnected via the LOGON command.

This enables you to leave your terminal briefly without leaving it logged on and therefore unavailable to another user. Your temporary files remain intact.

To use this command, simply enter:

disconn

Use the LOGOFF command to terminate a virtual machine Tmna1 Sessmi session and disconnect your virtual machine from the VM/SP system.

This command causes all active spool files to be closed, temporary disks to be relinquished, dedicated devices to be detached, and an accounting record to be created for the user.

Turning the power off on your terminal is not synonymous with logoff. On some terminals logoff occurs fifteen minutes after power off; on others it is fifteen minutes after the system discovers that the terminal power is off.

To use this command, simply enter:

logoff

WDS

ama Use the LOGON ccmmand to indentify yourself to the VM/SP Yourself Toxx system and to access that system. ,kx~~sbxj0 The format of the command is:

APPENDIX A - 1 logon userid [password]

T 4: Ad .. .._.. . i_ 3 ___I "- . ... --L o proUtect1ion is aesirea, then specify the optional field, password. Otherwise, the system will prompt you for your password and mask the characters.

Use the MESSAGE (or MSG) command to transmit message text to a specified userid or to the primary system operator.

The format of' the command is:

msg userid msgtext

operator

Where:

userid is the identification of the user who is to receive the message. * specifies that you are sending a message to yourself.

operator sends the message to the primary system operator regardless of his userid.

msgtest is the text of the message that is to be transmitted. The length of the message is limited to the number of characters remaining on the input line after entering the command and the appropriate operand.

Ievirnd A Real Tape Use the REWIND comnand to rewind (but not unload) a real Unit tape unit attached to your virtual machine at a specific virtual device address. To use this conmmand, simply enter:

rewind vaddr

Where vaddr is the specific virtual device address and may be 181, 182, 183, or 184.

APPENDIX A - 2 CF14LM

Inxk!btifying A Use the ACCESS command to indentify a disk to CMS, estab- Disk To CHS lish a filemode letter for the files on the disk, and set up a file directoryin storage. The specifications you make with the ACCESS command determine the entries in the user file directory. This command is commonly used in conjunction with the CP command, LINK. Let's add to the previously described LINK example an ACCESS cammand to pecify that any file on our 134 disk (that is linked to smith's 330 disk directory copy) has a filemode of f:

link to smith 330 as 134 rr rpasswd access 134 f

I - -L The disk specifier, f, should most coimonly be one that is unused as the system will ask if you want to throw away what was there before. Note: If you use LINKTO, the NCAR/SCD EXEC documented in Appendix D, the LINK and ACCESS are done for you.

Assemle A File Use the ASSEMBLE command to invoke the assembler to as- semble a file containing source statements. The file must have fixed-length, 80-character records. By de- fault, the assembler expects a CMS file with a filetype of ASSEMBLE. To use this command, simply enter:

assemble filename

aM

Cpearing Files Use the CCMPARE command to compare two CMS disk files of fixed or variable length format on a record for record basis and to display dissimilar records at the terminal. The format of the command is:

compare fileidl fileid2

Where fileidl and fileid2 are the file identifiers of the files to be compared. All three identifiers (filename, filetype, and filemode) must be specified. Any records that do not match are displayed at the terminal.

Let's compare one of smithes files with one we already have:

APPENDIX A - 3 compare oldprog fortran a smthprog fortran f

Copying Files Use the COPYFILE command to copy CMS disk files. Let's copy smith's program:

copyfile smthprog fortran f newprog fortran a

Notice that the complete file identifiers must be speci- fied again and the first file is the input file and the second is our copy on our "a" minidisk.

CP

The C Cb Use the CP cormand to transmit commands to the VM/SP con- trol program environment without leaving the CMS environ- ment. As described in Chapter 8, The EXEC 2 Facility, any imbedded CP commands in an EXEC 2 procedure must be proceeded by the characters, cp.

rasi Files Use the ERASE command to delete one or more files frcm a read/write disk. Let's erase our old program because we have copied a new to replace it and we"'re running out of disk space:

erase oldprog fortran a

Defining Files Use the FILEDEF command to override default file defini- tions. An example, given in Chapter 9, using this com- mand to reassign unit 5 so that data is read from a disk file follows:

filedef 5 disk mycards data a

Where Amycards', 'data', and 'a' make up the file inden- tifier.

For complete and detailed descriptions of the many types of formats and options that may be used with this com- mand, please refer to "IBM VM/SP: CMS Ccnmand and Macro

APPENDIX A - 4 Reference", order number SC19-6209.

Use the GLOBAL command to identify which CMS libraries are to be searched for macros, copy files, subroutines Liraries when processing subsequent CMS commands. The format of the comnand is:

global maclib [libnamel ... libname8] global txtlib [libnamel ... libname8]

Where:

maclib precedes the specification of macro libraries that are to searched for macros and copy files during the execution of language processor commands.

txtlib precedes the specification of text libraries to be for missing subroutines when the LOAD command is issued.

libnames are the filenames of up to eight libraries. Filetypes must be maclib and txtlib accordingly.

An example from Chapter 5, "Getting Started on the IBM 4341", is the following:

global maclib dmssp cmslib osmacro osmacrol tsomac

The Help FaIIity Issue the HELP command to use the CMS help facility. This facility allows you to display a menu of the cam- ponents for which HELP files are available, a menu of the HELP files available for a particular component, and the actual HELP files. HELP files contain descriptions, for- mats, and parameters of CMS and CP conmands, XEDIT sub- commands, and EXEC 2 control statements, and discriptions of CMS and CP messages. This facility is quite exten- sively treated in Chapter 6, The Help Facility. You may also just enter:

h

APPENDIX A - 5 and read the instructions.

la

Halt Terinal Use the HT Immediate command to suppress all terminal Ou p output generated by any CMS command or your program that is currently executing. To use this command key the fol- lowing:

(Note: to get the system's attention. "Holding will be displayed in full screen. may work as well.) ht (, , or may work as well to proceed.)

HX

Halt Execution Use the HX Immediate command to stop the execution of any CMS command or program, close any open files or I/O dev- ices, and return to the CMS command environment. The format of the command is simply:

(Note: to get the system s attention. "Holding will be displayed in full screen mode. may work as well.) hx (, , or may work as well to proceed.)

FistingFile Use the LISTFILE command to obtain specified information Infocmaticn about CMS files residing on accessed disks. The format of the command is:

listfile filename filetype filemode (or) * (or) * (or) *

Where:

APPENDIX A - 6 filename is the filename of the files for which information is to be collected. If an asterisk is coded in this field, all filenames are used. If you code an asterisk preceded by any number of characters, then files that begin with the specified characters are listed.

filetype is the filetype of the files for which information is to be collected. If an asterisk is coded in this field, all filetypes are used. If you code an asterisk preceded by any number of characters, then files that begin with the specified characters are listed.

filemode is the filemode of the files for which information is to be collected. If this field is omitted, only the a minidisk is searched. If an asterisk is coded, all disks are searched.

ADR

Leading Use the LOAD coTrnand to read one or more CMS TEXT files Relocatable object (containing relocatable object code) from disk and to Code load them into virtual storage, establishing the proper linkages between the files. The format of the command is:

load filenames...

Where "filenames..." specifies the names of the files to be loaded into storage. The files must have a filetype of TEXT and consist of relocatable object code. If a GLOBAL TXTLIB command has been issued, filenames may indicate the name of a TXTLIB member. See chapter ?, Running Jobs and Debugging Aids, for further explanation and an example.

Printing Files Use the PRINT command to print a CMS file on the spooled virtual printer. The format of the commnand is:

print fileindentifier

APPENDIX A - 7 Where "fileindentifier" is of the usual filename, file- type, filemode convention. See the section on spooling described earlier in this chapter for further explana- tion.

Ptrling Files Use the PUNCH command to punch a CMS disk file to your virtual card punch. The format of the command is:

punch fileindentifier

Where "fileindentifier" is of the usual filename, file- type, filemode convention. As we have no real card punch, this command would be used to spool and send files to another user. The following is the set of commands to do this:

spool d userid (d is the virtual address of virtual punch and userid is the other user's logon name) punch fileidentifier spool d off (Terminates spooling to the indicated user.)

As described immediately below, the other user would then use the RDR (or READCARD) command to read these files. See the section on spooling described earlier in this chapter for further explanation.

Reading Files Use the RDR (or READCARD) command to read data records from your virtual card reader and to create CMS disk files containing the data records. The format of the comnand is:

rdr fileindentifier (or readcard) (or *)

Where "fileindentifier" is of the usual filename, file- type, filemode convention. If the asterisk (or the fileindentifier is blank) is specified, then the system will respond with file and other information about the file being transferred from another user as mentioned in

APPENDIX A - 8 the preceding.

Free An Acoxssed Use the RELEASE command to free an accessed disk and make Disk the files on it unavailable. The format of the command is:

release cuu (or mode)

Where "cuu" is the virtual device address of the disk that is to be released, and "mode" is the filemode letter at which the disk is currently accessed. This command goes with the CP command DETACH (and if fact "(det" may be an option) just as ACCESS goes with the CP comnmand LINK. See the beginning of this chapter for information about DETACH and LINK.

Rsaing C(O Files Use the RENAME command to change the fileid of one or more CMS files on a read/write CMS disk. The format of the command is:

rename fileidl fileid2

Where the fileids are of the usual filename, filetype, filemode convention. "fileidl" is the original file identifier, "fileid2" is the new file identifier.

SORT

Sorting Records on Use the SORT command to read fixed length records from a Files CMS input file, arrange them in ascending EBCDID order according to specified sort fields, and create a new file containing the sorted records. The format of the command is:

sort fileidl fileid2

APPENDIX A - 9 Where the fileids are of the usual filename, filetype, filemode convention. "fileidl" is the file identifier of the file containing the the records to be sorted, and "fileid2" is the file identifier of the new output file to contain the sorted records.

Programs Use the START command to begin execution of CMS programs that were previously loaded by the LOAD comiand. The format of the command is:

See Chapter 9 for further explanation and an example.

TWE

Displaying Files Use the TYPE command to display all or part of a CMS file at the terminal. The format of the command is:

type fileid

I. .

Where the fileid is of the usual filename, filetype, filemode convention.

APPENDIX A - 10 SaMmMwcFo0 5[M~DS

This appendix contains alphabetical lists of the CMS carmmands and the func- tions performed by each. Included are both those commnands that are available for general use, and those that are used by system programmers and system sup- port personnel who are responsible for generating, maintaining, and updating VM/SP. Unless otherwise noted, CMS carommands are described in VM/SP CMS Ccm- mand and Macro Reference.

Code Meaning

DOS PP Indicates that this command invokes a DOS Program Product, available from IBM for a license fee.

EREP Indicates that this command is described in VM/SP OLTSEP and ERRDR Recording Guide. Further details on the operands used by this com- mand are contained in OS/VS Environmental Recording Editing and Printing (EREP) Program.

IPCS Indicates that this command is a part of the Interactive Problem Con- trol System (IPCS) and is described in VM/370 IPCS User's Guide.

Op Gd Indicates that this command is described in the VM/SP Operator's Guide.

OS PP Indicates that this command invokes an OS program product, available from IBM for a license fee.

SCRIPT Indicates that this command invokes a text processor that is an IBM Installed User Program, available from IBM for a license fee.

SPG Indicates that this ccmrand is described in the VM/SP System Programmer's Guide.

SYSGEN Indicates that this cormand is described in the VM/SP Planning and System Generation Guide.

In addition to the commands listed in this Appendix, there are seven commands called Immediate commands that are handled in a different manner from the others. They may be entered while another ocommand is executing by pressing the Attention key (or its equivalent) and are executed immediately. The Immediate commands are:

Q HB - Halt batch execution

I HO - Halt tracing

@ HT - Halt typing

@ HX - Halt execution

APPENDIX A - 11 9 RO - Resume tracing

SP RT - Resume typing

P SO - Suspend tracing

Commcand Code Usage

ACCESS Identify direct access space to a CMS virtual machine, create extensions and relate the disk space to a logical directory. AMSERV Invoke access method services utility func- tions to create, alter, list, copy, delete, import, or export VSAM catalogs and data sets.

ASSEMBLE Assemble assembler language source code. ASSGN Assign or unassign a CMS/DOS system or pro- grammer logical unit for a virtual I/O dev- ice.

CMSBACH Invoke the CMS batch facility.

COBOL Os PP Ccmpile OS ANS Version 4 or OS/VS COBOL source code.

COMPARE Compare records in CMS disk files. CONVERT OS PP Convert free form FORTRAN statements to fixed form.

COPYFILE Copy CMS disk files according to specifications.

CP Enter CP commands from the CMS environment. CPEREP EREP Formats and edits system error records for output.

DDR Perform backup, restore, and copy operations for disks.

DEBUG Enter DEBUG subcommand environment, debug mode. DISK Perform disk-to-card and card-to-disk opera- tions for CMS files.

DLBL Define a DOS filename or VSAM ddname and re- late that name to a disk file. DOSLIB Delete, compact, or list information about

APPENDIX A - 12 the phases of a CMS/DOS phase library.

DOSLKED Link-edit CMS text decks or object modules from a VSE/AF relocatable library and place them in executable form in a CMS/DOS phase library.

DOSPLI DOS PP Compile DOS PL/I source code under CMS/DOS.

DSERV Display information contained in the VSE/AF core image, relocatable, source, procedure, and transient directories.

EDIT Invoke the CMS editor to create or modify a disk file.

ERASE Delete CMS disk files.

ESERV Display, punch or print an edited (compressed) macro from a VSE/AF source statement library (E sublibrary).

EXEC Execute special procedures made up of fre- quently used sequences of ccmnands.

FCOBOL DOS PP Compile DOS/VS COBOL source code under CMS/DOS.

FETCH Fetch a CMS/DOS or VSE/AF executable phase.

FILEDEF Define an OS ddname and relate that ddname to any device supported by CMS.

FORMAT Prepare disks in 800-, 1024-, 2048-, or 4096-byte block format.

FORTGI OS PP Compile FORTRAN source code using the Gl com- piler.

FORTHX OS PP Compile FORTRAN source code using the H- extended compiler.

GENDIRT Fill in auxiliary module directories.

GENMOD Generate nonrelocatable CMS files (MODULE files).

GLOBAL Identify specific CMS libraries to be searched for macros, copy files, missing sub- routines, or DOS executable phases.

GOFORT OS PP Compile FORTRAN source code and execute the program using the FORTRAN Code and Go com- piler.

APPENDIX A - 13 HELP Display information regarding CP, CMS, or user-supplied commands and messages. INCLUDE Bring additional TEXT files into storage and establish linkages.

LABELDEF Specify standard HDR1 and EOF1 tape label description information for CMS, CMS/DOS, and OS simulation.

LIST D S List information about data sets and space allocation on OS, DOS, and VSAM disks.

LISTFILE List information about CMS disk files.

LISTIO Display information concerning CMS/DOS system and programmer logical units.

LOAD Bring TEXT files into storage for execution.

LOADMOD Bring a single MODULE file into storage.

MACLIB Create or modify CMS macro libraries.

D M MO AP Display the load map of a MODULE file.

MOVEFILE Move data from one device to another device of the same or a different type. OPTION Change the DOS COBOL compiler (FCOBOL) op- tions that are in effect for the current ter- minal session.

PLIC OS PP Compile and execute PL/I source code using the PL/I Checkout Compiler.

PLICR OS PP Execute the PL/I object code generated by the OS PL/I Checkout Compiler. PLIOPT OS PP Conpile PL/I source code using the OS PL/I Optimizing Compiler.

PRINT Spool a specified CMS file to the virtual printer.

PSERV Copy a procedure from the VSE/AF procedure library onto a CMS disk, display the pro- cedure at the terminal, or spool the pro- cedure to the virtual punch or printer.

PUNCH Spool a copy of a CMS file to the virtual punch.

APPENDIX A - 14 QUERY Request information about a CMS virtual machine.

READCARD Read data from spooled card input device.

RELEASE Make a disk and its directory inaccessible to a CMS virtual machine.

RENAME Change the name of a CMS file or files.

RSERV Copy a VSE/AF relocatable module onto a CMS disk, display it at the terminal, or spool a copy to the virtual punch or printer.

RUN Initiate series of functions to be performed on a source, MODULE, TEXT, or EXEC file.

SCRIPT SCRIPT Format and print documents according to em- bedded SCRIPT control words in the document file.

SET Establish, set, or reset CMS virtual machine characteristics.

SETPRT Establish, set, or reset virtual 3800 printer characteristics.

SORT Arrange a specified file in ascending order according to sort fields in the data records.

SSERV Copy a VSE/AF source statement book onto a CMS disk, display it at the terminal, or spool a copy to the virtual punch or printer.

START Begin execution of programs previously loaded (OS and CMS) or fetched (CMS/DOS).

STATE Verify the existence of a CMS disk file.

STATEW Verify a file on a read/write CMS disk.

SVCTRACE Record information about supervisor calls.

SYNONYM Invoke a table containing synonyms you have created for CMS and user-written commands.

TAPE Perform tape-to-disk and disk-to-tape opera- tions for CMS files and position tapes.

TAPE Perform tape-to-disk and disk-to-tape opera- tions for. CMS files, position tapes, and display or write VOL1 labels.

TAPEMAC Create CMS MACLIB libraries directly from an

APPENDIX A - 15 IEHMOVE-created partitioned data set on tape. TAPPDS Load OS partitioned data set (PDS) files or card image files from tape to disk. TESTCOB OS PP Invoke the OS COBOL Interactive Debug Program. TESTFORT OS PP Invoke the FORTRAN Interactive Debug Program.

TXTLIB Generate and modify text libraries. TYPE Display all or part of a CMS file at the term- inal. UPDATE Make changes in a program source file as de- fined by control cards in a control file.

VSAPL OS PP Invoke VS APL interface in CMS. VSBASIC 06 PP Compile and execute VS BASIC programs under CMS. VSBUTIL OS PP Convert BASIC 1.2 data files to VS BASIC format. XEDIT Invoke the System Product editor to create or modify a disk file.

APPENDIX A - 16 This appendix contains brief descriptions of all the commands acceptable to the CP component of the VM/SP system. Figure 11 contains an alphabetical list of the CP comiands, the privilege classes which may execute the command, and a brief statement about the use of each command.

Privilege Command Class Usage

* any Annotate the console sheet.

#CP any Execute a CP command while remaining in the virtual machine environment.

ACNT A Create accounting records for logged on users, and reset accounting data. ACNT also closes the spool file that is accumulating accounting records.

ADSTOP G Halt execution at a specific virtual machine instruction address.

ATTACH B Attach a real device to a virtual machine. B Attach a DASD device for CP control. B Dedicate all devices on a particular channel to a virtual machine.

ATIN G Make an attention interruption pending for the virtual machine console.

AUTOLOG A,B Automatically log on a virtual machine and have it operate in disconnect mode.

BACKSPAC D Restart or reposition the output of a unit record spooling device.

BEGIN G Continue or resume execution of the virtual machine at either a specific storage location or at the address in the current PSW.

CHANGE D,G Alter one or more attributes of a closed spool file.

CLOSE G Terminate spooling operations on a virtual card reader, punch, printer, or console.

COUPLE G Connect channel-to-channel adapters.

APPENDIX A - 17 CP any Execute a CP command while remaining in the CMS virtual machine environment.

DCP C,E Display real storage at terminal.

DEFINE B Redefine the usage of SYSVIRT and VIRTUAL 3330V devices. G Reconfigure your virtual machine.

DETACH B Disconnect a real device from a virtual machine. B Detach a DASD device from CP. B Detach a channel from a specific user. G Detach a virtual device from a virtual machine. G Detach a channel from your virtual machine. DIAL any Connect a terminal or display device to the virtual machine's virtual communication line. DISABLE A,B Disable 2701/2702/2703, 370X in EP mode, and 3270 local communication lines.

DISCONN any Disconnect your terminal from your virtual machine.

DISPLAY G Display virtual storage on your terminal. DMCP C,E Dump the specified real storage location on your virtual printer.

DRAIN D Halt operations of specified spool devices upon completion of current operation.

DUMP G Print the following on the virtual printer: virtual PSW, general registers, floating-point registers, storage keys, and contents of specified virtual storage loca- tions.

ECHO G Test terminal hardware by redisplaying data entered at the terminal.

ENABLE A,B Enable communication lines.

EXTERNAL G Simulate an external interruption for a vir- tual machine and return control to that machine.

FLUSH D Cancel the current file being printed or punched on a specific real unit record dev- ice.

APPENDIX A - 18 FORCE A Cause logoff of a specific user.

FREE D Remove spool HOLD status.

HALT A Terminate the active channel program on specified real device.

HOLD D Defer real spooled output of a particular user.

INDICATE A,E,G Indicate resource utilization and contention.

IPL G Simulate IPL for a virtual machine.

LINK G Provide access to a specific DASD by a virtu- al machine.

LOADBUF D Load real UCS/UCSB or FCB printer buffers.

LOADVFCB G Load virtual forms control buffer for a vir- tual 3203, 3262, 3289E, or 3211 printer.

LOCATE C,E Find CP control blocks.

LOCK A Bring virtual pages into real storage and lock them; thus, excluding them from future paging.

LOGOFF any Disable access to CP.

LOGON any Provide access to CP.

MESSAGE A,B,any Transmit messages to other users.

MIGRATE A Allows the operator to migrate pages either for the entire system or just one user.

MONITOR A,E Trace events of the real machine and record system performance data.

MSGNOH B Send a specified message, without the stan- dard message header, from one virtual machine to another.

NETWORK A,B,F Load, dump, trace, and control the operation of the 370X control program. Control the operation of 3270 remote devices.

NOTREADY G Simulate "not ready" for a device to a virtu- al machine.

ORDER D,G Rearrange closed spool files in a specific order.

APPENDIX A - 19 PURGE D,G Remove closed spool file from system.

QUERY ABC,.D, Request information about machine oonfigura- E,F,G tion and system status.

QVM A Request the transition from VM/SP to the V=R virtual machine running in native node.

READY G Simulate device end interruption for a virtu- al device.

REPEAT D Repeat (a specified number of times) printing or punching of a specific real spool output file.

REQUEST G Make an attention interruption pending for the virtual machine console.

RESET G Clear and reset all pending interruptions for a specified virtual device and reset all er- ror conditions.

REWIND G Rewind (to load point) a tape and ready a tape unit.

SCREEN G Allows the user to change or alter the color and extended highlighting values for his vir- tual console.

G Pass commands and message replies to disconnected virtual machine for processing.

SAVESYS E Save virtual machine storage contents, regis- ters, and PSW.

SET A,B,E, Operator--establish system parameters. F,G User--control various functions within the virtual machine.

SHUTDOWN A Terminate all VM/SP functions and checkpoint CP system for warm start.

SLEEP any Place virtual machine in dormant state.

SMSG G Send Special Messages to specified virtual machine.

SPACE D Force single spacing on printer.

SPM4DE A Establish or reset the single processor mode environment.

SPOOL G Alter spooling control options; direct a file

APPENDIX A - 20 to another virtual machine or to a remote lo- cation via the RSCS virtual machine.

SPTAPE D Dump output spool files on tape or load out- put spool files from tape.

START D Start spooling device after draining or changing output classes.

STCP C Change the contents of real storage.

STORE G Alter specified virtual storage locations and registers.

SYSTEM G Simulate RESET, CLEAR STORAGE, and RESTART buttons on a real system console.

TAG G Specify variable information to be associated with a spool file or output unit record dev- ice. Interrogate the current TAG text set- ting of a given spool file or output unit record device.

TERMINAL G Define or redefine the input and attention handling characteristics of your virtual con- sole.

TRACE G Trace specified virtual machine activity at your terminal, spooled printer, or both.

TRANSFER D,G Transfer input files to or reclaim input files from a specified user's virtual card reader.

UNLOCK A Unlock previously locked page frames.

VARY B Mark a device unavailable or available.

VMDUMP G Dump virtual machine when issued with the VM/IPCS Extension.

WARNING A,B Transmit a high priority message to a specifed user or to all users.

APPENDIX A - 21 APIE)IX B NCAR EXECs and Utilities

SECTION II Interactive Computing on the IBM 4341 7600JOB.

The 7600JOB commrand allows you to send a 7600 job deck over the network via the IBM 4341.

The command format is:

7600JOB

where: … filename: Is the filename of the file containing the 7600 JCL. Defaults to filename 7600'. filetype: Is the filetype of the file containing the 7600 JCL. Defaults to filetype JOBA.

Note: Your JCL file must reside on your a-disk!

Example -.

For example if you have a regular 7600 JCL commnand file called

7600JOB to get your job sent via the network to the 7600. If, on the other hand, you had a job deck written on a file called 'SAMPLE DECK' on your a-disk, you would have to type in

7600JOB SAMPLE DECK and your job would then be sent over.

APPENDIX-B 7600STAT The-7-00STAT-c----and-is-used-to-diplay-the-status-of-jobs-sent-to-th

The 7600STAT comnmand is used to display the status of jobs sent to the 7600. The command format is:

7600STAT

The file you will see displayed on your terminal screen operates like any other help file.

APPENDIX-B CRAYJOB ______

The CRAYJOB ccmmand allows you to send a CRAY job deck over the network via the IBM 4341.

The command format is:

CRAYJOB

where: ---- filename: Is the filename of the file containing the CRAY JCL. Defaults to filename 'CRAYA.

filetype: Is the filetype of the file containing the CRAY JCL. Defaults to filetype 'JOB'.

Example -----

For example if you have a regular CRAY JCL cormand file called

CRAYJOB

to get your job sent via the network. If, on the other hand, you had a job deck written on a file called 'SAMPLE DECK' you would have to type in

CRAYJOB SAMPLE DECK

and your job would then be sent over.

APPENDIX-B CRAYSTAT The C ___STAT ______adisused _todisplaythestatusofjobssent_ to_

The CRAYSTAT command is used to display the status of jobs sent to the CRAY. The command format is:

CRAYSTAT

The file you will see displayed on your terminal screen operates like any other help file.

APPENDIX-B FETCHL ------

The FETCHL command is used to transfer a library source file from the TBM to the IBM 4341 and into your virtual card reader. The crommand format is:

FETCHL

All command arguments are requested interactively. They are:

1. Your scientist and project numbers: enter both numbers on the same line, separated by a blank.

2. Library name: you will be given a list of the available libraries. Choose the one you want and enter it.

3. File name: enter the name of the library file you want transferred.

4. VM/370 filename and filetype: enter the filename and filetype you wish the requested library file to be known under on your a-disk.

Your job will be sent via the network. The system will come back with a message that a file has been purged (this is just a system scratch file that has been purged) and will tell you what network sequence number was assigned to your job.

The requested file will be put in your virtual card reader. To get the file on to your a-disk you can type in

RDR

The system will come back with a prompt as to whether you wish the file loaded or not. Type in Y for yes or N for no.

Note: A small word of warning about library files - presumably you are bringing library files over to modify them in some way for later use on the 7600 or Cray-1l. If you wish to check your modifications for syntax errors directly on the 4341 be forewarned that much of the fortran source is not compatible with the IBM fortran compilers, most notably things such as ENCODE/DECODE statements, using DATA statements to initialize variables occuring in labeled COMMON blocks, and using a * to represent multiple occurrences of a data item in a DATA statement. Thus, the best way to proceed would be to be to obtain an IBM compiler listing of the library source before any modifications have been done, so that you are aware of errors generated by fortran language incompatibilities and don't confuse them with your own possible errors.

APPENDIX-B FETCHP

The FETCHP command is used to transfer files stored on your PLIB volume to the IBM 4341 and into your virtual card reader. The command format is:

FEnCHP

All cammand arguments are requested interactively. They are:

1. Your scientist and project numbers: enter both numbers on the same line, separated by a blank.

2. PLIB project number: enter your PLIB project number.

3. PLIB file name: enter the name of the library file you want transferred.

4. VM/370 filename and filetype: enter the filename and filetype you wish the requested PLIB file to be known under on your a-disk.

Your job will be sent via the network. The system will come back with a message that a file has been purged (this is just a system scratch file that has been purged) and will tell you what network sequence number was assigned to your job.

To get the requested file from your virtual card reader on to your a- disk just type in

RDR and the system will come back with a prompt as to whether you wish the file loaded on to your a-disk or not. Type in Y for yes, N for no.

APPENDIX-B FETCHV --.----. ------…------

The FETCHV command is used to transfer files stored on the TBM (mass store) to the IBM 4341 and into your virtual card reader. The command format is:

FETCHV

All command arguments are requested interactively. They are:

1. Your scientist and project numbers: enter both numbers on the same line, separated by a blank.

2. Volume serial number (VSN): enter the name of the mass store volume on which the file you are requesting resides.

3. Volume file name: enter the name of the requested file as it is known on the mass store.

4. VM/370 filename and filetype: enter the filename and filetype you wish the requested file to be known under on your a-disk.

Your job will be sent via the network. The system will come back with a message that a file has been purged (this is just a system scratch file that has been purged) and will tell you what network sequence number was assigned to your job.

To get the requested file from your virtual card reader on to your a- disk just type in

RDR

The system will come back with a prompt as to whether you wish the file loaded on your a-disk or not. Type in Y for yes or N for no.

APPENDIX-B FORTVS ------

The FORTVS command does a FORTRAN 77 compile of a program, using the FORTVS compiler and any of FORTVS s libraries.

The command format is:

FORTVS file < (options) >

where -…

file: the filename of the file which you are compiling. The filetype must be 'fortran' and the filemode of the file defaults to the filemode of the first (alphabetically) disk found with a file called

options: are any valid compiler options

Example

For example, suppose you wanted to compile a fortran program you had on a file called 'program fortran d'. You would then type in

FORTVS program and your program would be compiled by the FORTVS compiler, using any of FORTVS's available libraries.

Note in this example that if you had had a file called 'program fortran a in addition to your other one, then the above command would have compiled each other or rename them.

APPENDIX-B LINKTO ______

The LINKTO command allows you to link to and access someone else's disks. You must specify who it is that owns the disk you are trying to access, and you may optionally specify which of his/her disks you wish to link to, what address you wish to have assigned to it, and what filemode you wish to access it with. What is not specified will be supplied by certain defaults. After entering any form of the LINKTO command you will be prompted by the system for the read password of the disk you are trying to link to.

The command format is:

LINKTO userid virtaddrl virtaddr2 mode

where:

userid: the userid of the owner of the disk which is being linked to.

virtaddrl: The virtual address of the disk being linked to as known on its owner's virtual machine. The default address is 191.

virtaddr2: Any valid virtual address of your virtual machine to which you wish to have the disk attached. The default is the first virtual address available to your virtual machine starting at 120.

mode: Filemode with which the disk is to be accessed. The default is the first filemode which is available to your machine.

Example ----

In the following examples no explicit mention has been made of requiring you to enter the read password of the disk you are trying to link to. In practice, of course, for each of the following LINKTO calls, you would be prompted by the system for the read password in question.

Suppose you are attached only to your own a-disk at address 191 and your own d-disk at address 192. If you wish to link to the a-disk of user JACK you might simply type in

LINKTO JACK

APPENDIX-B You would then be linked to JACK's a-disk at address 120, with a filemode of b, which is the default filemode in this case since it is the first filemode available to your machine.

If you now wished to also link to JACK's d-disk at his virtual address of 192 you would type in

LINKTO JACK 192

Since you have not specified otherwise, you will have access to his d- disk at your virtual address of 121 (remember you have his a-disk already at 120), with a filemode of c since it is the first available filemode (you have already used a and b), and you did not explicitly specify another filemode to access it with.

Next, suppose you wish to access JILL s a-disk, but you do not want it at your virtual address of 122, which would otherwise be the current default virtual address. If you wanted to attach her a-disk to your virtual address 300 you would type in

LINKTO JILL 191 300

The filemode you have accessed JILL's disk with is, by default, e, since a and d have been reserved for your own disks, and you have already used b and c for JACK's disks.

Finally, suppose you want JILL s d-disk at address 350 and you wish to have it accessed with a filemode of m, then you would type LINKTO JILL 192 350 m

Remember that if you specify a filemode which has already been used then you will replace whatever had been accessed previously with that filemode. For instance, in the above case, if you had specified a filemode of 'a' instead of 'm', you would now no longer be linked to your a-disk.

APPENDIX-B MAIL ______

The MAIL comand reads, and allows the user to review, messages sent by the TO command. The command format is:

MAIL

Usage ----

The MAIL command, at present, has no arguments. MAIL appends new messages to the file MBOX MAIL A (which is first created, if it does not exist), and then prompts the user for a command. The commands are as follows:

Delete : Mark the listed messages for deletion. Deletion does not actually occur until a QUIT command is given. A message may be recovered, i.e., unmarked, with the UNDELETE command.

Next: Type the next message.

Quit: Exit MAIL. This command deletes marked messages and then terminates the MAIL command.

Type : type messages. This command types the listed messages on the terminal.

Undelete : Remove delete marking from messages. See DELETE.

is one of the following:

1. Nothing, in which case the action is performed on the current message.

2. One or more message numbers, separated by one or more blanks, in which case the action is performed on each of the listed messages.

3. "All", in which case the action is performed on each message.

Notes

1. The "current message" is always the last one which was acted upon.

2. The first letter of each command is all that is required, and, in fact, all that is recognized. That is, TARP 5 causes message number 5 to be output on the screen (if there is a message 5) just as TYPE 5, T 5, and Tanything 5 do.

APPENDIX-B 3. The must be separated from the command by at least one blank. This means that, while the command D 5 will correctly mark message 5 for deletion (if there is a message 5), D5 will not. In fact, D5 will mark the current message for deletion as will D23 or Danything]

APPENDIX-B MOUNT___------

The mount command requests a tape mount for a user. The request is repeated automatically until specifically cancelled by the user or by the operator.

The command format is:

MOUNT tapenum virtaddr trk den in/out

where:

tapenum: Is the number of the tape to be mounted (VSN).

virtaddr: Is the virtual address you assign to the tape, which can be either 181,182,183, or 184.

trk: This is the first parameter in the comment field and is used to tell the operators how many tracks your tape has.

den: This is the second parameter in the comment field and is used to tell the operators the density of your tape in bits/inch.

in/out: Specify either in or out. The option in tells the operators to leave the write ring in your tape, the out option tells them to leave it out.

Example -----

Suppose you have a tape with VSN number B19999, which is a 9-track, 1600 bpi tape, and you wish to have the tape mounted with the write ring in. You would issue the command

MOUNT B19999 181 9 1600 in

Note in this example that there was nothing special in choosing 181 for a virtual address - you may choose 181,182,183, or 184.

IMPORTANT - Do not forget to detach the virtual address at which you attached your tape to indicate to the operators that your tape mount is now free for someone else. You do this by issuing the conmmand

APPENDIX-B DETACH virtaddr

i.e., for the the above example, after you were done with your tape you would need to issue the command

DETACH 181

To cancel a pending mount request, the format is:

MOUNT CANCEL tapenum

To query what mounts you have pending, the format is:

MOUNT QUERY

If you need to send the operators a message for any reason you can use the dummy tape number 000 to issue a dummy tape mount, i.e.

MOUNT 000 181 *important message*

Note that on half-duplex terminals, once the system has returned to you after entering a MOUNT or a MOUNT CANCEL command, you must press another return to get the system message back as to whether the request was accepted or rejected. Note that just because your request was accepted does not mean it was necessarily successful. That message will come back to your terminal some time later.

If you attempt the MOUNT command and get an error message back or get a rejection message back, first check your syntax carefully. If you are absolutely sure that your syntax is correct, try using a different virtual address, it is possible the address you are trying to use has already been requested and is in use.

Note -- Although the IBM documentation for the MOUNT command specifies a "for" option that allows you to request a tape mount for someone else, this is not supported at NCAR.

APPENDIX-B NETSTAT

______------

The NETSTAT command displays the status of your network jobs. The cofmmand format is:

NETSTAT

Your network messages are appended to a file called NETWORK MESSAGES A on an ongoing basis. Therefore, to avoid excessive clutter, you should use the editor to delete those entries you no longer need.

APPENDIX-B PASSRD--- -Th- PA R co and is ------used to ch e yr CP l o ------n s .

The PASSWORD command is used to change your CP logon password. The command format is:

PASSWORD

When you enter this cormand, the system will prompt you for your new password and then ask you to enter in your old one to validate the change.

APPENDIX-B PRTEM__ _, p ------

The PRITERM command (from PRinT TERMinal) is issued scmetime after the invocation of the SAVTERM ccmmand (see section on SAVTERM) to send to the printer all that has been listed on your terminal since the last invocation of SAVTERM. The command format is:

PRTTERM

Example See the example under SAVTERM. -

APPENDIX-B QUERYPASS------______--______

The QUERYPASS command displays your disk passwords. The command format is:

QUERYPASS

The system will prompt you for your logon password for validation.

APPENDIX-B READPW -.---. The.....A c.....an. allows you.to.change.the.read.password.ofoneofyo

The READPW co, and allows you to change the read password of one of your disks. The command format is:

READPW virtaddr passwrd

where: ----

virtaddr: Is the virtual address of the disk whose read password you want to change.

passwrd: Is the new read password you want to assign.

The system will prompt you for these arguments if you omit them. You will also be prompted to enter your logon password for validation.

Example ------

Suppose you want to change the password of your 192 disk to 'newpass'. You would enter

READPW 192 newpass

The system would then prompt you for your logon password. It takes a minute or so for the change to take effect, and on some terminals you may need to enter a carriage return to get the message back that the update has been made.

Caution: Changing your read passwords invalidates certain parameters on your network defaults file. This would necessitate you explicitly mentioning your link read passwords on certain network commands, at least until your defaults file can be updated. As updates are presently done only manually, you are urged to use discretion on changing your passwords.

APPENDIX-B SAVTEIRM --______------__-----

The SAVTERM command (from SAVe TERMinal) spools your console to the printer so that you can have a hard copy of everything that gets listed on your terminal until you issue the PRTTERM command (see PRTTERM). The command format is:

SAVTERM

Example ---- For example, suppose you have a long list of files on your a-disk and you wish to have a hard copy of the list, instead of always having to display that list on your terminal screen. You could then type in the command

SAVIERM and then type the command

LIST * * a and, finally,

PRMTERM and you would get your hard copy.

APPENDIX-B - STATUS

STATUS displays batch job execution status information for jobs submitted to a specified rernDte Network node. The execution status of all batch jobs on the specified remote node is displayed as the default. Alternatively, the user may specify one or more search strings; only those jobs whose status information contains at least one of the specified search strings will have its status information displayed.

The format oI the STATUS command is:

STATUS network_node_name [search string...]

Parameters: network node name is the name of the Network node for which batch job execution status information is to be displayed. It must be one of the following values:

C1 CRAY-1A X6 CDC-7600 76 A synonym for X6 search_string... is one or more optional character strings. The character string may contain any character except the character "blank". Only those jobs whose status information contains at least one of the specified character strings will have its status information displayed. Typical search strings are programmer names, job names, sequence numbers, etc. If no search strings are specified, batch job execution status information for all jobs is displayed.

APPENDIX-B STORAGE ------…------

The STORAGE command allows you to increase the virtual memory size of your virtual machine.

The command format is:

STORAGE size

where:

size: Size is measured either in kilo- (thousand) or mega- (million) bytes of memory. For kilo-bytes the specification is

nnnK and for mega-bytes it is

nnM

Note that you are assigned 512K bytes of memory by default. When you issue the STORAGE command, it disables your virtual machine since your are altering it, and puts you back in CP. To reload your virtual machine with its altered memory size you must enter

IPL CMS

The system will remind you to do this so you won't forget.

Note also that you are limited to a maximum of 1m of virtual memory.

Example

If you enter

STORAGE lm you have requested the system for an even mega-byte of virtual memory (twice the default). Note that increased virtual memory size has nothing to do with real memory size, and in particular has nothing whatsoever to do with disk space size. It is valid only in the context of an executing program.

APPENDIX-B Also, your altered virtual memory size is effective only during the terminal session in which you alter it. Once you have logged off, your memory size reverts to its original default.

APPENDIX-B TEMPDISK ______-______

The TEMPDISK command gets a temporary disk of up to 20000 blocks and formats it. The virtual address assigned to the temporary disk will be the first available address at 500 or above, and the mode will be the first mode available to your virtual machine.

The command format is:

TEMPDISK SIZE

where:

size: Is the number of blocks for the temporary disk, up to 20000. Defaults to 5000.

Example --.

Suppose you, the user, have disks a at virtual address 191, d at virtual address 192, and have attached some disk b at virtual address 500. Then entering the command

TEMPDISK 15000 will attach and format a temporary disk of 15000 blocks at address 501 and with mode c. Note that without disk b, the above command would have attached your temporary disk at address 500 instead of 501, and would have given it a filemode of b instead of c.

Caution -- You may have a great need for a temporary disk if you are cramped for space but beware that a mistake which causes you to be put back into CP may very likely destroy any temporary disk you may have. If you get put back into CP for any reason, type in

BEGIN immediately and if the system comes back with the CMS prompt, you have recovered your temporary disk(s), but if it comes back with CP again, you have lost your temporary disk(s). In fact, you must reload your CMS virtual machine by typing in

IPL QMS

In particular, should you decide to increase your virtual storage using the STORAGE command, you will lose all your temporary disk storage since the STORAGE commnand disables your machine and places you in CP.

APPENDIX-B TO------…------

The TO command sends a message to one or more users.

TO where: ---

userid: Each userid specified is the logon name of a user to whom the message will be sent.

Usage ---

If at least one user id is not given on the command line, TO prompts the user for user ids.

When TO prompts for the identity of the sender of the message (From:), the user may input a string of characters which will serve as a more meaningful indication of the identity of the sender of the message than the sender's user id. The latter is supplied by TO automatically.

When TO prompts for the subject of the message (Subject:), the user may input a string of characters which serves as an indication of the purpose of the message.

TO invokes the editor to allow the user to input the text of the message. When the user leaves the editor, TO prompts the user (send, abort, or edit?) before actually doing anything with the message. If the user types send (or just a carriage return), TO sends the message to the previously specified users. If the user types abort, TO discards the message and exits. If the user types edit, TO invokes the editor again to allow the user to review or change the message.

Example ------

Typing

TO smith jones calls TO to send a message to users smith and jones.

APPENDIX-B WHOIS

------I------

The WHOIS command is used to find out a person's logon name when you know part or perhaps all of his/her regular name (say if you want to send them mail, for instance), or conversely, given a logon name you can find out who belongs to that logon name. Occasionally more than one real user will be operating under a specific (project) logon name.

The command format of the WHOIS command is:

WHOIS < name > where can be any of the following:

null: if you do not specify an argument a synopsis will be displayed. * : if you specify a star, an entire list of all users and their names will be displayed at your terminal. * if you specify a question mark, a synopsis will be displayed

or any valid logon name (whose user name you are seeking) or any valid user first name or user last name (whose logon name you seeking). Don't give both a first and a last name since only the first will be used in the search anyway. You may use * as a character in your name, subject to the restriction that a * may appear only as the first or last character of the name or may appear as both first and last, i.e., you may not have a * embedded in the name.

APPENDIX-B WRITEPW ------

The WRITEPW command allows you to change the write password of one of your disks. The command format is:

WRITEPW virtaddr passwrd

where:

virtaddr: Is the virtual address of the disk whose write password you want to change.

passwrd: Is the new write password you want to assign.

The system will prompt you for these arguments if you omit them. You will also be prompted to enter your logon password for validation.

Example

Suppose you want to change the password of your 192 disk to 'newpass'. You would enter

WRITEPW 192 newpass

The system would then prompt you for your logon password. It takes a minute or so for the change to take effect, and on some terminals you may need to enter a carriage return to get the message back that the update has been made.

Caution: Changing your write passwords invalidates certain parameters on your network defaults file. This would necessitate you explicitly mentioning your link write passwords on certain network commands, at least until your defaults file can be updated. As updates are presently done only manually, you are urged to use discretion on changing your passwords.

APPENDIX-B TTLEB Preliminary Information on Tape I/O Routines for the 4341 Dennis Joseph 11 May 1981

- - - 04-, , .I --- I Ki LAJLX:r, Following are brief descriptions of routines which have been developed and subjected to preliminary testing for performing tape functions on the IBM 4341 system. In most cases, these routines will require more extensive testing before they can be used by the general user. The Data Support Section will be making use of these routines during the next few weeks and this should provide addi- tional verification. Although not a direct I/O routine, we currently have a GBYTES operational on the 4341 and hope to soon have an SBYTES.

1BO To access the tape I/O routines for the IBM 4341 type the following:

link joseph 192 111 read access 111 f

General Ccoments The collection includes subroutines and main programs for and Limitations commonly performed tape functions, and most routines are slanted toward meeting the needs of the DSS. A few basic routines are written in assembler, but all routines are intended to be called from Fortran programs or subrou- tines. Under the current set up, logical unit numbers for tape operations are restricted to numbers 1 through 4 which correspond directly to CMS logical units 181 through 184. The correspondence between CMS logical un- its and the physical drives (380 through 383) is esta- blished through MOUNT commands and the subsequent opera- tor initiated ATTACH, and possibly changed later through user initiated DEFINE operations. Except for MOUNT and DETACH operations, the tape I/O functions are performed through direct CCW operations using DIAGNOSE and not through CMS or CP commands. FILEDEF's are usually not required. Commands like TAPE MODESET are not necessary but may be used to set up proper track and density re- quirements before program execution. Individual file, record length, and blocksize specifications are meaning- less to these I/O routines. Basic Tape I/D The routines RDTAPE (Assembler), WRTAPE (Assembler), and IOWAIT (Fortran) are provided. The argument list is identical to current usage and functions provided are similar. Note that I/O is not really asynchronous and IOWAIT merely returns status and length values.

APPENDIX-B:TAPE I/O - 1 Differencxs The length limit in RDTAPE is specified in words(32-bit), but all other lengths (returned from IaOAIT and length to be written in WRTAPE) are specified in bytes (8-bit). The 3rd argument type of RDTAPE and WRTAPE is meaning- less. The mode argument is consistent with current usage on 9-track tapes, but note that since the IBM system uses EBCDIC internally, both mode 1 and mode 2 result in an unaltered bit stream transmission. ASCII conversions (mode 0), are done in RDTAPE and WRTAPE through internal tables and the IBM translate instruc- tion. RDTAPE reads a block and translates the result to EBCDIC. WRTAPE translates the buffer to ASCII, writes the block, and restores the buffer to EBCDIC. For 7- track tapes, an additional operation (see SETIOD) is re- quired to insure the desired type of data transmission.

Additinal Tape The two assembler routines listed below are used by the Subroutines other tape functions but rarely called directly by a user program. IOTAPE sends commands to the tape drives through CCW's executed by DIAGNOSE commands and CMSEXC issues CMS and CP commands through Fortran calls. All other routines are Fortran.

IOTAPE(iun,icc,istat,ist) -

Intended for issuing tape operations through CCW's where transmitting of user data is not involved.

iun - Fortran logical unit (1 through 4) icc - Command Code for this operation istat - Integer*4 buffer dimension 6 for return from sense bytes when sense commands are issued. ist - status return from CSW.

CMSEXC (com,irtc) -

Issues CMS commands and returns the return code. com - Real*8 vector of left justified character elements of a CP/CMS command. The last element must be 3HEND. There is currently a limit of 11 elements. irtc - Return Code.

REWIND (IUN) ,BSPACE (IUN) ,SKFILE(IUN) ,BKFILE (IUN),UNLOAD (IUN) -

These routines issue the obvious tape functions through calls to IOTAPE. They will not be loaded unless the pro- gram contains a reference to ICTAIT. The use of UNLOAD is discouraged since it causes tape unload but not a detach.

APPENDIX-B:TAPE I/O - 2 MNTTP(iun,tapl,iden,iring) -

Requests a tape to be mounted. Before actually using the tape, a call to MNTWT should be issued on this unit. iun - Logical tape unit. tapl - Real*8 variable with left justified tape label (eg B32450) iden - tape density and (for 7-track) read mode(see SETMOD). iring - ring option where 0 is read only and 1 is read or write.

MNTWT(iun,iden,ist) -

Waits for tape to be mounted before proceding. If no tape has been mounted for this unit after 30 minutes, control is returned to the calling program with a nonzero status return (ist). iun - Logical tape unit which corresponds to that used in MNT TP. iden - same as in the corresponding MNTTP. ist - status return where 0 is OK and nonzero is error.

DETACH (iun) -

Does detach on Fortran logical unit.

SETMOD(iun,mode) -

Sets density and (for 7-track) mode for given Fortran logical unit. Data Convert (DC) on results in contiguous bit stream transmission from the 7-track drives to memory and DC off results in each 6-bit tape frame being stored in an 8-bit byte. Translate on converts from or to external BCD to or from EBCDIC. Note that by far the most commonly used 7-track options will be 6 and 11 for unaltered bit stream transmissions and 10 and 15 for BCD tapes, both at 556 and 800 respectively. iun - Logical unit. mode - One of 18 possible parity, density, read mode com- binations.

APPENDIX-B:TAPE I/O - 3 Mode Density DC Translate Parity 1 200 on off odd 2 200 off off odd 3 200 off on odd 4 200 off off even 5 200 off on even 6 556 on off odd 7 556 off off odd 8 556 off on odd 9 556 off off even 10 556 off on even 11 7-800 on off odd 12 7-800 off off odd 13 7-800 off on odd 14 7-800 off off even 15 7-800 off on even 16 9-800 ______.-- _ _ _... 17 9-1600 18 9-6250

O-tther Program We have several general purpose programs for tape opera- tions which we will be using for our initial tape manipu- lation. Some come directly from the equivalent routine on the current systems and others were developed on the 4341.

TAPECY - The tape copy currently being used on the 7600.

TPDUMP - Tape dump which we use internally on the 7600, but modified to be used interactively on the 4341.

TPSCAN - Reads a tape and summarizes file, block, and byte content.

TPCOPY - A tape copy for the 4341 which is intended to be used for copying from one density to another with multiple volumes in and out and testing for full tape conditions.

TPCOMP - Compares single files from two tapes to insure they are identical.

APPENDIX-B:TAPE I/O - 4 APND/XE C Keyboard Templates

SECTION II Interactive Computing on the IBM 4341 VT 1 00

Keyboard Layout for 3277 Emulation via Series/1 for terminal type VT1 00.

-PF16:0UUl -P2 c SCROLL SHIFTSHIFTAB BI L j SHFT LIE l. SPACE Next Page

Legend: (XXX - Striking the key while depressing CTRL yields the function XXX. These are independent of upper/lower case. -XXX - The 2 char sequence, ESC, key, yields the function XXX. =XXX - The 3 char sequence, ESC, ESC, key, yields the function XXX. XXX - The key yields the function XXX directly. A - The key should not be depressed. Inadvertent use of these keys may require "DISP" and/or "RSET". Functions marked in lower case symbols are seldom used, or the marked key is a secondary way to activate the function. FMNMBD PIE lK]fHLIST for the VW100 Functions Commonly Used With CP, CMS, and XEDIT: (Keystroke >[] means to use key [] on the numeric keypad)

Function Description Keystroke Mnemonic Reminder & Ccnments CLR Clear CrRL-Z (Z)ap screen DEL Delete Character (DEL)ete character -Down Cursor key marked with arrow ETTR Enter INSM Insert Mode On/Off CTRIL-N i(N)sert mode on/off LEFT Left Cursor LEFT key marked with arrow CDr BACZKSPACE NWLN Newline LIT Y I PAl Usually Means >l-1 PA keys 1 to 3 are located Enter CP Mode sequentially PA2 Usually Means Display > [ENTER] (ENPER) next page when display indicates (MDRE) PA3 Program Access Key 3 >[,] PFl-10 PF Keys 1 to 10 >[11] numeric keypad gives tto >[0] PF key of same digit PF4 PF4 (XEDIT Tabkey) TAB (T)abkey for XEDIT c)r >[4] PF11 >[,] PF12 >[-] PFll-20 ESC,> [1] Preceding ESC adds 10 to tto ESC,>[0] all PF keys PF21 ESC,> [,] PF22 ESC,> [-] GHT Right Cursor SHT key marked with arrow UP Up Cursor UP key marked with arrow

Functi DeDsT riX tDo[aeTesi

Function Description Keystroke

DISP Display Refresh CR-D (D)isplay refresh edx Enter Series/1 EDX Sys CTRL-C Not for general use pta Purge Type-ahead CrRL-P (P)urge type-ahead buffer RSET Error Reset CTRL-R (R)eset after error trel Type-lock Release CTRL-T (T)ype-lock release xoff Transmission Control CTRL-S To be avoided xon Transmission Control CTRL-Q Tob be avoided

NOTE: If "xoff" is typed inadvertently, the user should type "xon" to restore normal transmission. Other situations may require "RSET".

"FINED /mTumN- -Km

Function Description Keystroke Mnemonic Reminder & Carnents ffld Forward Field CTRL-F (F)orward field skip bfld Back Field CrRL-B (B)ackward field skip eeof Erase to End of Field CRL-E (E)rase field einp Erase Input Fields ESC,I (I)nput erase dup Duplicate Field ESC, fm Field Mark ESC,; hone Home Cursor ESC,H (H)ane

11 . i PERKIN-ELMER 1 100 (FOX)

Keyboard Layout for 3277 Emulation via Series/1 under terminal type PE1 100.

HERE CLEAR _ESC IS ALL

~AA~~ T

u / LINEED . LI LF CTRL FEED A

BREAK SCROL RE- BEAR ENABL PEAT SHIFT Q Z T A VI \~~ .... A

SPACE

Legend: (XXX - Striking the key while depressing CTRL yields the function XXX. These are independent of upper/lower case. -XXX - The 2 char sequence, ESC, key, yields the function XXX. = XXX - The 3 char sequence, ESC, ESC, key, yields the function XXX. XXX - The key yields the function XXX directly. V - The key should remain depressed for propper emulation. A - The key should not be depressed. Inadvertent use of these keys may require "DISP" and/or "RSET". Functions marked in lower case symbols are seldom used. Fu nctiosCeLIST for EaXDO Functions Commnonly Used With CP, CMS, and XEDIT: cI Function Description Keystroke Mnemonic Reminder & Camrents

CLR Clear CTRL-Z (Z)ap screen DEL Delete Character EEL (DEL)ete character DOWN Down Cursor CTRL-J directly below "up" or LINEFEED ENTR Enter Insert Mode On/Off CTRL-N i(N)sert nmode on/off LEFT Left Cursor CrRL-K see "up" or BACKSPACE NWLN Newline CTRL-G (G)o to next line PA1 Usually Means CTRL-^ PA keys are positioned Enter CP Mode sequentially PA2 Usually Means Clear CTRL-DEL (DEL)ete current page when to Next Page or CTRL- display indicates (MRE) PA3 Program Access Key 3 CTRL-] PFl-12 PF Keys 1 to 12 ESC,1 PF keys are positioned to ESC,' sequentially and PF11-24 PF Keys 11 to 24 ESC,ESC,1 are as mnemonic as to ESC,ESC,] possible PF4 PF4 (XEDIT Tabkey) TAB (T)abkey for XEDIT or ESC,4 RGHT Right Cursor CTRL-L see "up" UP Up Cursor CTRL-U (U)p cursor DOWN Down Cursor CTRL-J keys for up, down, left LEFT Left Cursor CTRL-K and right, form a RGHT Right Cursor CTRL-L convenient pattern

Function Description Keystroke

DISP Display Refresh CTRL-D (D)isplay refresh edx Enter Series/l EDX Sys CTRL-C Not for general use pta Purge Type-ahead (P)urge type-ahead buffer RSET Error Reset (R)eset after error trel Type-lock Release CTRL-T (T) ype-lock release xoff Transmission Control CTRL-S To be avoided xon Transmission Control CTaLr-Q To be avoided

NOTE: If "xoff" is typed inadvertently, the user should type "xon" to restore normal transmission. Other situations may require "RSET".

Function Description Keystroke Mnemonic Reminder & Ccmments ffld Forward Field CRL-F (F)orward field skip bfld Back Field CIRL-B (B)ackward field skip eeof Erase to End of Field CTRL-E (E)rase field einp Erase Input Fields ESC,I (I)nput erase dup Duplicate Field ESC,: fm Field Mark ESC,; hane Hare Cursor ESC,H ()oane cursor ADM 3A+

Keyboard Layout for 3277 Emulation via Series/1 for terminal type ADM3A. Enter - /Enter CP Mode

-PA1 -PA2 -PA3

BREAK HERE S PROG > A A A tI HOME N -- -These are used as PF Keys 11 through 24 when preceded by ESC, ESC- e--These are used as PF Keys 1 through 12 when preceded by ESC-- - -- 7 8 m- PF7 -PF8 PF9 =PF17 'PF18 tPF9

PF4 4 546 -PF4 -PF5 -PF6 =PF14 =PF15 =PF16 Page ENTR 1 2 3 PFI PF2 PF3 R =PFi1 =PFI2 =PF13 E T - U u R N

CLEAR -PF10 A -PF20

SPACE CONTROL i _ j~~~~~~CONTROL

Legend: (XXX Striking the key while depressing CTRL yields the function XXX. These are independent of upper/lower case. -XXX - The 2 char sequence, ESC, key, yields the function XXX. =XXX - The 3 char sequence, ESC, ESC, key, yields the function XXX. XXX The key yields the function XXX directly. V - The key should remain depressed for propper emulation. A The key should not be depressed. Inadvertent use of these keys may require "DISP" and/or "RSET". Functions marked in lower case symbols are seldom used. INJXFM Elm1 LIST for the FKAL Functions Commonly Used With CP, CMS, and XEDIT:

FUNCTION4 DE FRUI'IN KEYSTROKE MNENCIC REC4INDER & COMMENTS CFRL- CLR Clear (Z)ap screen DEL Delete Character RUB (RUB)out character DOWN Down Cursor key marked with arrow or LIN FI D ENTR Enter RETURN INSM Insert Mode On/Off CT'R-N i (N)sert node on/off LEFT Left Cursor LEET key marked with arrow NWN Newline CTRL-G (G)o to next line PAl Usually Means PA keys 1 to 3 are located Enter CP Mode sequentially PA2 Usually Means Display (RUB)out current page when Next Page or ESCDOM display indicates (MORE) PA3 Program Access Key 3 ESC,RGHT PFl-12 PF Keys 1 to 12 ESC,1 PF keys are positioned tto0ESC,- sequentially and PF11-24 PF Keys 11 to 24 ESC,ESC,1 are as mnemonic as t:0o ESC,ESC,] possible PF4 PF4 (XEDIT Tabkey) TAB (T)abkey for XEDIT c)r ESC,4 RGHT Right Cursor key marked with arrow UP Up Cursor UP key marked with arrow

.M... .? . TOm r, r.,, Function Description Keystroke

DISP Display Refresh CTRL-D (D) isplay refresh edx Enter Series/I EDX Sys CrRL-C Not for general use pta Purge Type-ahead CTRL-P (P)urge type-ahead buffer RSET Error Reset CTRL-R (R)eset after error trel Type-lock Release CTRL-T (T)ype-lock release - xoff Transmission Control CrRL-S To be avoided xon Transmission Control CTRL-Q To be avoided

NCE: If "xoff" is typed inadvertently, the user should type "xon" to restore normal transmission. Other situations may require "RSET".

Function Description Keystroke Mnemonic Reminder & Camments

ffld Forward Field CTRL-F (F)orward field skip bfld Back Field CTRL-B (B)ackward field skip eeof Erase to End of Field CTRL-E (E)rase field einp Erase Input Fields ESC,I (I)nput erase dup Duplicate Field ESC,@ fm Field Mark ESC,; home Wane Cursor H0ME Hewlett-Packard 2648-A

Keyboard Layout for 3277 Emulation via Series/I under terminal type HP264BA

N n "N M M /N W \/ '"\ \/ """ "\ / N N N \ / N " N N \ / N N N N N \ / N N N N \ /NNNNN\ /"""ONN \ I II DISPII II I I If 11 1 I I PFI I I PF2 I I PF3 I I PF4 I I PF11i1 PF121 I 11 11 I 1I I fl I I f2 I I f3 I I f4 I ' 1I 1a 1AII I L I-PF1 1 I I I EI 11 L 4A I-PF121 I-PF131I I-PF14 I I-PF2111-PF221 …_..../ \ ... . .IX..../\…/\ …./\…_.../ \ ...../ \- -- / / RESET TAPE DISP BLOCK \ ..... /\ ..... / READ RCORD INSRT DELET TRMNL TEST FUNC MODE LINE LINE

/ NNNNN\/ "N N "N U \/ \/ MNWNUN / "N X \ / "N N U \ N I / ""\ /"""n"\ \ /NNNNN\/ #M #NM\ I PF55 I I PF6 I I PF7 I I PF8 I I INSMNI DEL I B BB11 BB B B| |B B I f 5 I f6 I I f7 I I f8 I \7 II I I ^ BA I L X 1 LI 1-PFIi51 I-PF161 I-PF171 I-PF18 \ . . ./\ …..../\ ….../\ …_.../ \_____/ X_.../ \_... t \ -.--- / RMOTE CAPS MEMRY AUTO ENTER BREAK INSRT DELET LOCK LOCK LF CHAR CHAR

B i / NNNN \ / N N UN M\ / MN N \ I II II IBI II II I I I I II II I I II II leftl I PF9 I I I B 11 i I PF101 BII 11 IfI CLR I II " IIB II $ II % C & 1BII ' 11 (C ) B IB 11 1B IB I AUTO BACK I I I I I G I ICLEARII SET IICLEARI I ESC II 1 11 2 11 3 II 4 II 5 BI 6 II 7 II 8 II 9 1I 0 II - B II II \ IISPACEI I PLOT I I I ICURSRI I TAB II TAB II DISPI I-PF191 I Z& I I-PF201 /w.../\ /NNNNN\/NN NN"X\/NNNN \/NN MN »\/NNUNN X/NNNN"\/UNMNEN\/"U NNN \/NNm "NN\/N""" \/NNN""N\/"NNN N\/ "mNNN\#X/N N \ /***. .\ N N N N\/ M NUN M\/ UNi NUN I PF4 I 11 I I I(RSETII(trelll I 11 1B1 1I(Pta ICI C 11 eeof I I I I II II PA2 I I 1 IIC II I I IC I I ICI I I II I I ^ I I I I I I I ( II DEL I I IROLL BI /I\ IINEXT I TAB II Q II W II E II R II T II Y II U BI II 0 ICI P. CC I II [ II - I I I ISTOP I I UP II I I I II PAGEI I zo I I II \ .. .\…...../\…… . . /….__ …/../\..… ./\/\….../\…..../\…..../x_..../ I I II I \ ...../\ ..... /\ ..... / N / N N N N \/ N N /N"N\ N N N N N \/ N N N/N N N \/ U N N NN\ /N N N N N X/ U NNBN\/N N N/N N N \/ N N N/"/"N NN\ " "NN\N N NN\ N NXNUI\/ NN \ /""""N\/"""""\/""""M\ I I I I I ZOOM I IZOOM C B C I I IN I I OUT I I CC CC 11 1B 1 1 11 11 IC BC C B C -fm |1-dup CI 11 I I I Li I I I I OW--IIHO \E P-- I \ -.... / . \.. / \ … …/ \ … …/ …/ \ /\ I II I I 1 I I 11 II (entrl I CCI C I I R I I I CC CC I I NNWLNII LNII IfIBI PAlPAI II IIBC CC I I I I I I < ICI I I ? CI CI N C I FAS' I I I T I I I IROLL 1| I |IPREV I I SHIFT II Z II X II C II V II B II N II II , CC . C / 11 SHIFT 11 I IROLL II I IIPREV I I CURS( OR I IZOOM I I DOWNI I \1/ II PAGEI I …....X...... /\ …//\… \------s./\pac/\…. .X/\…..../\…../. ./e ...... / \-..... /

space I I I I SPsp

Leqend: (XXX - striking tne key while depressing CTRL yields function XXX. These are independent of upper/lower case. -XXX - the 2 char sequence, ESC,Key, yields function XXX. XXX - the key yields the function XXX directly. %7 - the key should remain depressed for proper emulation. 4 - the key should not be depressed. Inadvertent use of these keys may require "DISP" and/or "RSET". Functions marked in lower case sYmbols are seldom used, or the marked Key is a secondary way to activate the function. HP2648A EMULATED FUNCTION LIST

Functions Commonly Used With CPr CMS, and XEDIT:

Function Description Keystroke Mnemonic Reminder & Comments a maW- a m aW aa a m amm m a mm mma Omma a a a a a a as a a a a a ma a m a9mmma mammam a CbR Clear CLEAR DSPLY DEL Delete Character DELETE CHAR DOhN Down Cursor DOWN key marked with arrow ENTR Enter RETURN INSM Insert Mode On/Off INSERT CHAR LEFT Left Cursor LEFT key marked with arrow BACKSPACE N4LN Newline ROLL DOWN PAl Usually Means PREV PAGE Enter CP Mode PA2 Usually Means Clear NEXT PAGE to Next Paqe PA3 ProQram Access Key 3 none PFI-8 PF Keys 1 to 8 fl PF keys are positioned to f8 sequentially PF4 PF4 (XEDIT Tabkey) TAB (T)abkev for XEDIT or f4 PF9 PF Key 9 AUTO PLOT PFO1 PF Key 10 G CURSOR PF 11 PF Key 11 INSERT LINE PF12 PF key 12 DELETE LINE PF1 1-22 PF keys 11 to 22 ESC followed by PF1-12, i.e., ESC adds 10 RGHT Riqht Cursor RIGHT key marked with arrow UP Uo Cursor UP key marked with arrow

Functions Used to Control the Emulator:

Function Descriotion Keystroke

DISP Display Refresh TAPE TEST edx Enter Series/1 EDX SVs CTRL-A Not for qeneral use ota Purqe Type-ahead CTRL-P (P)urqe type-ahead buffer RSEr Error Reset CTRL-R (R)eset after error trel Type-lock Release CTRL-T (T)ype-lock release xoff Transmission Control CTRL-S To be avoided xon rransmission Control CTRL-Q To be avoided

NOTE: If "xoff" is typed inadvertently, the user should type "xon" to restore normal transmission. Other situations .may require "RSET",

Functions Useful Primarily With Field Formatting:

Function Description Keystroke Mnemonic Reminder & Comments mmmmamaCTRL-RIGHT key marked with arrow ffld Forward Field CTRL-LEFRIGHT key marked with arrow bfid Back Field CTRL-LEFT key marked with arrow eeof Erase to End of Field DEL (DEL)ete to end of field eino Erase Input Fields CTRL-CLEAR DSPLY duo Duplicate Field ESC,: fm Field Mark ESC,; home Home Cursor HOME key marked with arrow INDEX

4341 COMPUTING SYSTEM, CFIRST Subcommand, 4-23 THE IBM, 1-1 CFIRST Subcommand, 4-42 4341 FULL-SCREEN EDITOR, CHANGE Subcommand, 4-20 THE IBM, 4-3 CHANGE Subcommand, 4-46 4341 LINE EDITOR, CINSERT Subcommand, 4-22 THE IBM, 4-35 CINSERT Subcommand, 4-43 4341 VM/SP COMMAND LANGUAGE FACILITY, CLOCATE Subcommand, 4-18 IBM, 5-1 CLOCATE Subcommand, 4-42 7600 JOB, 6-15 (.CM Format Word), 3-18 Absolute Binary Module, (CMS), 1-4 Creating and Using an, 6-9 CONVERSATIONAL MONITOR SYSTEM, 1-5 ACCESS, 5-3 VIRTUAL DEVICES UNDER, 1-6 Access Mode Password, FILES IN, 1-9 Changing Disk, 2-17 GETTING ACQUAINTED WITH, 2-10 ALLOCATION, UNDERSTANDING, 2-1 DISK PERMANENT FILE SPACE, 1-14 Batch FORTRAN in, 6-9 ALTER, 4-31 CMS Command Format, 2-4 ARBCHAR, CMS Command Language, SET, 4-31 The, 2-3 Arguments, CMS EXEC, Variable, 5-2 The, 5-10 ASSEMBLER LANGUAGE PROGRAMMING, 6-10 CMS System Editor, 1-6 ASSIGNMENT STATEMNTS, CMS VIRTUAL MACHINE, 2-1 VARIABLE, 5-4 Codes, "AT" Statement, Creating an EXEC for Frequently Run, 6-9 The, 6-11 Column Pointer, 4-37 AUTOSAVE Subcommand, CMM4AND LANGUAGE FACILITY, SET, 4-25, 4-54 IBM 4341 VM/SP, 5-1 Backspace Characters, 4-61 Command Operands, 2-4 BACKWARD and FORWARD Subcommands, 4-17 Commands, 1-6 Batch and Interactive Programs, 1-2 *Comments, 5-3 Batch FORTRAN in CMS, 6-9 Comments in HELP Files (.CM Format Word), BCD to EBCDIC, 6-4 Placing, 3-18 Binary Module, Compilation Error Messages, 6-3 Creating and Using an Absolute, 6-9 Components, 1-8 Blocks, 1-8 COMPRESS, EXPAND, 4-31 BOTTOM Subcommands, Configuration, 1-1 TOP and, 4-17 Control Program, BOTTCM Subcommands, VM/SP, 1-3 TOP and, 4-41 CONTRDL STATEMENTS, (.BX Format Word), EXEC 2, 5-4 Enclosing Text, 3-16 CONVERSATIONAL MONITOR SYSTEM (CMS), 1-5 Cancel, 5-12 COPY Subcomnmand, 4-53 Canceling Prefix Subcommands, 4-16 COPYFILE, 5-3 CAPPEND Subcorrmand, 4-45 CP Command Language, 2-2 Card Punch, 1-6 CP Command Structure, 2-3 Cards, CP LINK, 5-3 Getting Your Program CP Resource Management, 1-3 onto Your Disk From, 6-8 CP Resource Records, 1-3 CASE, CRAYJOB, 6-16 SET, 4-31 (.CS Format Word), 3-18 CDELETE Subcnmmand, 4-44 Current Line (/),

i Setting the, 4-16 Editing a File, 4-35 D Prefix Subcommand, 4-13 EDITING ON THE IBM 4341, 4-1 Data, Editing Session, Entering, 4-6, 4-36 Ending an, 4-24 Data, EDITING SESSION, Causing a Break in the, 4-8 ENDING AN, 4-53 Data From Another File, Editing Symbols, Inserting, 4-26, 4-55 Logical Line, 2-5 DATA PASSING, Editor, INTERACTIVE, 5-9 CMS System, 1-6 Debug, Learning More About the, 4-31 FORTRAN Interactive, 6-10 EDITOR, Debug Session, THE IBM 4341 LINE, 4-35 FORrRAN, 6-11 THE IBM 4341 FULLSCREEN, 4-3 Debugging Aids, 'END" Subcommands, Other, 6-13 The ARUN" and, 6-12 DEBUGGING JOBS ON THE IBM 4341, Entry Mode, 2-5 RUNNING AND, 6-1 ERROR MESSAGES, 6-14 DEBUGGING ON THE IBM 4341, 6-10 Error Messages, Detach, 5-12 Compilation, 6-3 Digit, EXEC 2, 5-1 Filemode, 1-12 EXEC 2 CONTROL STATEMENTS, 5-4 Directory, 1-5 EXEC 2 File, Disk Access Mode Password, How To Create an, 5-2 Changing, 2-17 EXEC 2 Procedures, Disk From Cards, Using, 5-2 Getting Your Program EXEC 2 USER VARIABLES, 5-2 onto Your, 6-8 EXEC, Disk From Tape, PROFILE, 2-10 Getting Your Program The CMS, 5-10 onto Your, 6-8 EXEC File Statements DISK PERMANENT FILE or Commands, 5-1 SPACE ALLOCATION, 1-14 EXEC for Frequently Run Codes, DISKS, Creating an, 6-9 FORMATTING THE VIRTUAL, 2-9 Execs, 2-19 VIRTUAL, 2-14 Execs, Disks, Special, 5-10 Permanent Virtual, 2-14 EXECS, Sharing Virtual, 2-15 NCAR, 5-11 Temporary Virtual, 2-15 Execution, 6-4 Accessing Your Virtual, 2-16 &EXIT, 5-6 Releasing Virtual, 2-17 EXPAND, Display of Text (.CS Format Word), COMPRESS, 4-31 Conditional, 3-18 File, *DISPOSE, 6-15 News, 2-19 Documentation, Creating the HELP, 3-11 XEDIT, 4-3 Formatting the HELP, 3-16 DOWN and UP Subcommands, 4-18 Moving Through, 4-17, 4-38 DOWN Subcommands, Making Changes ,4-18, 4-41 UP and, 4-39 Inserting a Whole, 4-26, 4-55 EBCDIC, Inserting Data BCD to, 6-4 From Another, 4-26, 4-55 Editing, Inserting Part Full-Screen, 4-1 of Another, 4-26, 4-56 Line, 4-1 Creating a, 4-35

ii Editing a, 4-35 FORTRAN WARNINGS, How To Create an EXEC 2, 5-2 FORIVS, 6-13 Changing the Format, 6-4 FORTVS FORTRAN WARNINGS, 6-13 FILE CHARACTERISTICS, 'fortvs' Statement, CHANGING, 6-4 The, 6-2 File Length, 1-8 FORWARD Subcommands, FILE SPACE ALLOCATION, BACKWARD and, 4-17 DISK PEANENT, 1-14 Full-Screen Editing, 4-1 File Space Management, 1-5 FULL-SCREEN EDITOR, File Statements or Commands, THE IBM 4341, 4-3 EXEC, 5-1 Global Change, FILE Subcommand, 4-24 Making a, 4-21, 4-46 FILE Subcommand, 4-53 'GO' Subcommand, Filedefs, The, 6-12 Using, 6-5 &GOTO, 5-6 Filemode, 1-11 Help, Filemode Digit, 1-12 Getting, 4-31 Filenames, 1-9 HELP CC4,AND, Files, ISSUING THE, 3-2 Manipulation of, 1-12 HELP FACILITY, Packing and Unpacking, 1-13 THE, 3-1 Permanent or Temporary, 1-9 USING THE, 3-1 FILES, 1-8 HELP File, FILES, Creating the, 3-11 HCW TO CREATE HELP, 3-10 Formatting the, 3-16 PERUSING HELP, 3-6 HELP FILES, Files (.CM Format Word), HOW TO CREATE, 3-10 Placing Comments in HELP, 3-18 PERUSING, 3-6 FILES IN CMS, 1-9 HELP Files (.CM Format Word), FILES USED AND CREATED Placing Comments in, 3-18 BY THE FORTRAN PROCESS, 6-1 IBM 4341, Filetypes, 1-9 GETTING STARTED ON THE, 2-1 FLOW, EDITING ON THE, 4-1 LOGIC, 5-5 XEDIT on the SCD, 4-1 FLOW, DEBUGGING ON THE, 6-10 PROCESSING, 5-7 HOW TO SUBMIT A JOB (.FO Format Word), TO THE CDC 7600 FROM, 6-14 Use of Format Mode, 3-18 SUBMITTING A JOB TO Format Mode (.FO Format Word), THE CRAY-1 FROM THE, 6-16 Use of, 3-18 RUNNING AND DEBUGGING JOBS, 6-1 Formatting the HELP File, 3-16 IBM 4341 FULL-SCREEN EDITOR, FORMATTING THE VIRTUAL DISKS, 2-9 THE, 4-3 Fortran, IBM 4341 LINE EDITOR, Free-form, 6-5 THE, 4-35 FORTRAN Debug Session, 6-11 IBM 4341 VM/SP FORTRAN in CMS, COMMAND LANGUAGE FACILITY, 5-1 Batch, 6-9 &IF, 5-5 FORTRAN Interactive Debug, 6-10 IFTRAN, FORTRAN JOB, USING, 6-10 RUNNING A SIMPLE, 6-2 (.IN Format Word), FORTRAN Libraries, 2-18 Indenting Text, 3-19 FORTRAN PROCESS, Information, FILES USED AND CREATED BY THE, 6-1 Typing and Displaying, 5-4 FORTRAN PROGRAMING, INPUT Subcommand, 4-36 MORE SOPHISTICATED, 6-5 INPUT Subcommand, 4-6

iii INTERACTIVE DATA PASSING, 5-9 and Series 1, 2-8 Interactive Debug, &LOOP, 5-7 FORTRAN, 6-10 LOWERCAS, UPPERCAS, 4-31 Interactive Programs, Memory, Batch and, 1-2 Central, 1-7 Interrupt and Resume, 2-19 Menus, I/O Overhead, 1-8 Creating, 3-10 JOB, MENUS, 3-5 RUNNING A SIMPLE FORTRAN, 6-2 Message, 5-12 JOBS ON THE IBM 4341, MESSAGES, RUNNING AND DEBUGGING, 6-1 ERROR, 6-14 LABELS, 5-6 Messages, LEFT, RIGHT, 4-31 Compilation Error, 6-3 Libraries, Minidisks, 1-7 FORTRAN, 2-18 Mode, Line (/), Entry, 2-5 Setting the Current, 4-16 Mode (.FO Format Word), Line, Use of Format, 3-18 Inserting Words in a, 4-11 Mode Password, Inserting A, 4-47 Changing Disk Access, 2-17 Replacing a, 4-51 Module, Line Editing, 4-1 Creating and Using Line Editing Symbols, an Absolute Binary, 6-9 Logical, 2-5 MOUNT, 5-12 LINE EDITOR, MOVE Subcommand, 4-51 THE IBM 4341, 4-35 NCAR EXECS, 5-11 Line Pointer, 4-38 NCAR Terminals, Lines, Using the PACX from, 2-6 Adding and Deleting, 4-12 News File, 2-19 Duplicating, 4-14 NULLS Subcommand, Moving and Copying, 4-14 Using the SET, 4-12 Inserting and Deleting, 4-47 (.OF Format Word), Deleting, 4-50 Use of Offsets, 3-21 Splitting and Joining, 4-9 Offsets (.OF Format Word), LINES, Use of, 3-21 MOVING AND COPYING, 4-51 Operands, Lines of Text (.SP Format Word), Communand, 2-4 Spacing Between, 3-23 Output Characters (.TR Format Word), LINK, Translating, 3-24 CP, 5-3 Overhead, LINKTO, 5-12 I/O, 1-8 'LIST' Subcommand, PA2 Key, The, 6-12 Using the, 4-11 LISTBRKS' Subcommand, PACX and Series 1, The, 6-12 Log-on through the, 2-8 LOAD Statement, PACX from NCAR Terminals, Continuing a, 6-3 Using the, 2-6 "load' Statement, PACX from Remote Sites, The, 6-3 Using the, 2-7 LOGIC FLOW, 5-5 Password, Logical Line Editing Symbols, 2-5 Changing Disk Access Mode, 2-17 Logical Record Length, Password, Changing the, 6-5 Your Userid and, 2-5 Log-on through the 3705, 2-7 Password, Log-on through the PACX Changing Your, 2-6

iv PASSWORD, 5-12 Resource Records, Passwords, 1-7 CP, 1-3 PF KEYS, Resume, USING THE, 3-7 Interrupt and, :2-19 (PF) Keys, RIGHT, Using Program Function, 4-8 LEFT, 4-31 POINT, RSCS, 1-5 SET, 4-31 'RUN" and "END" Sulbcommands, Pointer, The, 6-12 Column, 4-37 SAVTERM, 5-13 Pointer, SCREEN, Line, 4-38 SET, 4-31 POWER Subcommand, 4-7 Scrolling Backward and Forward, 4-10 Prefix Subcommand, Series 1, A, 4-12 Log-on through the PACX and, 2-8 Prefix Subcommand, SET ARBCHAR, 4-31 D, 4-13 SET AUTOSAVE Subcommand, 4-25 PREFIX Subcammands, SET AUTOSAVE Subcomnand, 4-54 Using, 4-12 SET CASE, 4-31 Prefix Subcommands, SET NULLS Subcommand, Canceling, 4-16 Using the, 4-12 &PRINT, SET POINT, 4-31 &TYPE, 5-5 SET SCREEN, 4-31 PROFILE EXEC, 2-10 'SET' Subcommand, PROFILE XEDIT, 5-11 The, 6-12 Program, SET VERIFY, 4-31 VM/SP Control, 1-3 Sites, Program Function (PF) Keys, Using the PACX frnom Remote, 2-7 Using, 4-8 &SKIP, 5-8 Program onto Your Disk From Cards, SORT, 4-32 Getting Your, 6-8 (.SP Format Word), Program onto Your Disk From Tape, Spacing Between Lines of Text, 3-23 Getting Your, 6-8 SPACE ALLOCATION, PROGRAMMING, DISK PERMANENT FILE, 1-14 ASSEMBLER LANGUAGE, 6-10 Space Management, PROGRAMMING, File, 1-5 MORE SOPHISTICATED FORTRAN, 6-5 STORAGE, 5-13 Programs, Subcommand, Batch and Interactive, 1-2 Redisplaying a, 4-11 PRTTERM, 5-12 Re-executing a, 4-11 Punch, A Prefix, 4-12 Card, 1-6 Using the SET NULLS, 4-12 QUIT Subcommand, 4-24 D Prefix, 4-13 QUIT Subcommand, 4-53 CLOCATE, 4-18, 4-42 &RC, 5-6 CHANGE, 4-20, 4-46 &READ, 5-9 CINSERT, 4-22, 4-43 Record Length, CFIRST, 4-23, 4-42 Changing the Logical, 6-5 FILE, 4-24, 4-53 Records, QUIT, 4-24, 4-53 CP Resource, 1-3 SET AUTOSAVE, 4-25, 4-54 RELEASE, 5-3 INPUT, 4-6, 4-36 Remote Sites, TYPE, 4-39 Using the PACX from, 2-7 CDEL2ETE, 4-44 Resource Management, CAPPEND, 4-45 CP, 1-3 MOVE, 4-51

v COPY, 4-53 LOWERCAS, 4-31 PCOWER, 4-7 Userid and Password, The "GO, 6-12 Your, 2-5 The 'LIST-, 6-12 Variable Arguments, 5-2 The "LISTBRKS, 6-12 VARIABLE ASSIGNMENT STATEMENTS, 5-4 The ASET', 6-12 VARIABLES, The 'TRACE', 6-12 EXEC 2 USER, 5-2 Using PREFIX, 4-12 VERIFY, Canceling Prefix, 4-16 SET, 4-31 BACKWARD and FORWARD, 4-17 VIRTUAL DEVICES UNDER CNS, 1-6 TOP and BOTTOM, 4-17 VIRTUAL DISKS, 2-14 DOWN and UP, 4-18 Virtual Disks, UP and DOWN, 4-39 Permanent, 2-14 TOP and BOTTCM, 4-41 Sharing, 2-15 Other, 6-12 Temporary, 2-15 The 'RUN" and "END", 6-12 Accessing Your, 2-16 SUBMITTING A JOB TO THE CRAY-1 Releasing, 2-17 FROM THE IBM 4341, 6-16 VIRTUAL DISKS, Symbols, FORMATTING THE, 2-9 Logical Line Editing, 2-5 VIRTUAL MACHINE, System Editor, CMS, 2-1 CMS, 1-6 VIRTUAL MACHINE CONCEPTS, 1-1 Tab Characters, 4-59 VM/370, 1-2 Tabs, VM/SP, Setting, 4-23, 4-60 CCMMUNICATING WITH, 2-2 Tape, VM/SP COMMAND LANGUAGE FACILITY, Mounting a Physical, 6-7 IBM 4341, 5-1 Getting Your Program onto VM/SP Control Program, 1-3 Your Disk From, 6-8 WARNINGS, TEMPDISK, 5-13 FORTVS FORTRAN, 6-13 Terminal, XEDIT, The, 2-5 PROFILE, 5-11 Terminals, XEDIT Comnmand, 4-3, 4-35 Using the PACX from NCAR, 2-6 XEDIT Documentation, 4-3 Terminals Available, 1-1 XEDIT on the SCD IBM 4341, 4-1 Text (.BX Format Word), XEDIT Subset, Enclosing, 3-16 Summary of, 4-32, 4-62 Text (.CS Format Word), Conditional Display of, 3-18 Text (.IN Format Word), Indenting, 3-19 Text (.SP Format Word), Spacing Between Lines of, 3-23 TOP and BOTTOM Subcommands, 4-17, 4-41 (.TR Format Wbrd), Translating Output Characters, 3-24 &TRACE, 5-3, 5-4 "TRACE' Subcommand, The, 6-12 &TYPE, &PRINT, 5-5 TYPE Subcommnand, 4-39 UP and DCWN Subcommands, 4-39 UP Subcommands, DOWN and, 4-18 UPPERCAS,

vi