March 30, 1919 Section 8. Developing OS Programs under eMS eMS simulates many of the functions of the Operating System (OS), allowing you to compile, execute and debug as programs interactively. For the most part, you do not need to be concerned with the eMS OS simulation routines; they are built into the CMS system. Before you can compile and execute as programs in CMS, however, you must be acquainted with the following: • OS macros that eMS can simulate • Using as data sets in CMS • How to use the FILEDEF command • creating CMS files from OS data sets • using CMS and OS macro libraries • Assembling programs in CMS • Executing programs These topics are discussed below. Additional information for as VSAM users is in "Section 10. Using Access Method Services and VSAM Under CMS and CMS/DOS." For a practice terminal session using the commands and techniques presented in section 8, see "Appendix D: Sample Terminal Sessions.r. The eMS system uses many OS terms, but there are a number of OS functions that CMS performs somewhat differently. To help you become familiar with the some of the CMS equivalents (where they do exist) for OS terms and functions, see Figure 11. It lists some commonly-used OS terms and discusses how CMS handles the functions they imply. Section 8. Developing as Programs Under CMS 127
March 30, 1919 Section 8. Developing OS Programs under eMS eMS simulates many of the functions of the Operating System (OS), allowing you to compile, execute and debug as programs interactively. For the most part, you do not need to be concerned with the eMS OS simulation routines; they are built into the CMS system. Before you can compile and execute as programs in CMS, however, you must be acquainted with the following: • OS macros that eMS can simulate • Using as data sets in CMS • How to use the FILEDEF command • creating CMS files from OS data sets • using CMS and OS macro libraries • Assembling programs in CMS • Executing programs These topics are discussed below. Additional information for as VSAM users is in "Section 10. Using Access Method Services and VSAM Under CMS and CMS/DOS." For a practice terminal session using the commands and techniques presented in section 8, see "Appendix D: Sample Terminal Sessions.r. The eMS system uses many OS terms, but there are a number of OS functions that CMS performs somewhat differently. To help you become familiar with the some of the CMS equivalents (where they do exist) for OS terms and functions, see Figure 11. It lists some commonly-used OS terms and discusses how CMS handles the functions they imply. Section 8. Developing as Programs Under CMS 127
March 30, 1979 printer or punch, of any spool files produced hy that device. With the SPOOL command, you spool your virtual device to the RSCS virtual machine. You can also use the TRANSFER command to transfer files frem your own virtual card reader. The CP commands TAG, SPOOL, and TRANSFER are discussed in detail in the publication !££ 124 VM/370 CMS User's Guide
Pg. of GC20-1819-2 Rev March 30, 1979 by Supp. SD23-9024-1 for 5748-XX8 Part 2. Program Development Using eMS You can use CMS to write, develop, update, and test: • OS programs to execute either in the CMS environment (using OS simulation) or in an as virtual machine • DOS programs to execute in either the CMS/DOS environment or in a DOS virtual machine • CMS programs to execute in the CMS environment The OS and DOS simulation capabilities of CMS allow you to develop OS and DOS programs interactively in a time-sharing environment. When your programs are thoroughly tested, you can execute them in an as or DOS virtual machine under the control of VM/370. "Section 8. Developing OS Programs Under CMS" is for programmers who use OS. It describes procedures and techniques for using CMS commands that simulate OS functions. "Section 9. Developing DOS Programs Under CMS" is for programmers who use DOS. It describes procedures and techniques for using CMS/DOS commands to simulate DOS/VSE functions. If you use VSAM and access method services in either a DOS or an OS environment, "Section 10. Using Access Method Services and VSAM in CMS and CMS/DOS" provides usage information for you. It describes how to use CMS to manipulate VSAM disks and data sets. You can use the interactive facilities of CP and CMS to test and debug programs directly at your terminal. "Section 11. How VM/370 Can Help You Debug Your programs" shows examples of commands and debugging techniques. The CMS batch facility is a CMS to another machine for execution. to a CMS batch virtual machine is CMS Batch Facility." feature that allows you to send jobs How to prepare and send job streams described in "Section 12. Using the As you learn to use CMS, you may want to write programs for CMS applications. "Section 13. programming for the CMS Environment" contains information for assembler language programmers: linkage conventions, programming notes, and macro instructions you can use in CMS programs. Part 2. Program Development Using CES 125
Pg. of GC20-1819-2 Rev March 30, 1979 by Supp. St23-9024-1 for 5748-XX8 os Term/Function Cataloged procedure Data set Data Definition (DD) card Data Set Control Block (DSCB) EXEC card Job Control Language (JCL) Link-editing Load module Object module Partitioned data set STEPCAT,JOBCAT STEPLIB, JOBLIB Utility pro grail Volulle Table of Contents (VTOC) CMS Equivalent EXEC files can execute command sequences similar to cataloged procedures, and provide for conditional execution based on return codes from previous steps. Data sets are called files in CMS files are always sequential but CMS simulates OS partitioned data sets. CMS reads and writes VSAM data sets. The FlLEDEF command allows you to perform the functions of the DD statement to specify device types and output file dispositions. Information about a CMS disk file is contained in a file status table (FST). To execute a program in CMS you specify only the name of the program if it is an EXEC, MODULE file, or CMS command. To execute TEXT files, use the LOAD and START commands. CMS and user-written commands perform the functions of JCL. The eMS LOAD command loads object decks (TEXT files) into virtual storage, and resolves external references; the GEHMOn command creates absolute nonrelocatable modules. eMS MODULE files (resulting from the LOAD and GEHMOD commands) are nonrelocatable. Language compiler output is placed in CMS files with a filetype of TEXT. CMS MACLlBs and TXTLlBs are the only CMS files that resemble partitioned data sets. VSAM catalogs can be assigned for jobs or job steps in eMS by using the special ddnames IJSYSCT and lJSYSUC when identifying catalogs. The GLOBAL command estatlishes macro and text libraries; you can indirectly provide job libraries by accessing and releasing CMS disks that contain the files and programs you need. Functions similar to those performed by the OS utility programs are provided by eMS commands. The list of files on a eMS disk is contained in a file directory for 800-byte format eMS disks, or in the file directory for CMS disks with a 1024-, 2048-, or 4096-byte block format Figure 11. as Terms and CMS Equivalents 128 IBM VM/370 eMS User's Guide
Using OS Data Sets in eMS You can have as disks defined in your virtual machine configuration; they may be either entire disks or minidisks: their size and extent depends on their VM/370 directory entrieso You can use partitioned and sequential data sets on as disks in CMS. If you want, you can create CMS files from your as data sets. If you have data sets on as disks, you can read them from programs you execute in CMS, but you cannot update them. The CMS commands that recognize as data sets on as disks are listed in Figure 12. Command ACCESS ASSEMBLE nDR DLBL FILEDEF GLOBAL I I I I I LISTDS I MOVEFILE QUERY RELEASE STATE I ! Operation Makes the as disk containing the data set available to your CMS virtual machine. Assembles an as source program under CMS. Copies an entire as disk to tape. Defines as data sets for use with access method services and VSAM files for program input/output. Defines the as data set for use under CMS by associating an as ddname with an as data set name. Once defined, the data set can be used by an as program running under eMS and can be manipulated by the other commands that support as functions. Makes macro libraries available to the assembler. You can prepare an as macro library for reference by the GLOBAL command by issuing a FILEDEF command for the data set and giving the data set a filetype of MACLIB. Lists information describing as data sets residing on as disks. Moves data records from one device to another device. Each device is specified by a ddname, which must have been defined via You can use the MOVEFILE command to create CMS files from as data sets. Lists (1) the files that have been defined with the FILEDEF and DLBL commands (QUERY FILEDEF, QUERY DLBL), or I (2) the status of as disks attached to your virtual machinel (QUERY DISK, QUERY SEARCH). I Releases an as disk you have accessed (via ACCESS) from your CMS virtual machine. verifies the existence of an as data set on a disk. Before STATE can verify the existence of the data set, you must have defined it (via FILEDEF). I I I I I I I Figure 12. CMS Commands That Recognize as Data Sets and as Disks Section 8. Developing as programs Under CMS 129