Pg. of GC20-1819-2 Rev March 30, 1979 by Supp. St23-9024-1 for 5748-XX8 What To Do When You Run oat of Space • 88 Summary of EDIT Subcommands. • • • 91 SECTION 6. INTRODUCTION TO THE EXEC PROCESSOR • • • • • • creating EXEC Files. Invoking EXEC Files. PROFILE EXECs ••••• • 95 • 95 • 96 • 97 Your PROFILE EXEC. 98 CMS EXECs and How To Use Them. • 98 Modifying CMS EXECs. • .100 Summary of the EXEC Language Facilities.l00 Arguments and Variables. • • • • .101 Assignment Statements. • • • • • .102 Built-in Functions and Special Variables • • • • • • • • Flow Control in an EXEC •• Comparing Variable Symbols and Constants • • • • • • • • Doing I/O With an EXEC •• Monitoring EXEC Procedures .103 .103 .105 .106 .107 Summary of EXEC Control Statements and Special Variables • • • • • • • • .109 SECTION 7. USING REAL PRINTERS, PUNCHES, READERS, TAPES • .113 CMS Unit Record Device Support • • .113 .113 .115 Using the CP Spooling System • • Altering Spool Files • .. • • • • Using your Card Punch and Card Reader in CMS. • • • • • • • • • • .116 Handling Tape Files in CMS ••••••• 118 Using the CMS TAPE Command •••••• 119 Tape Labels in CMS • • • • • • • .121 Tape Labels in CMS •••••• 121 User Responsibilities .122 Label Processing in OS Simulation X!§)· • • • • • • • • • Label Processing in CMS/DOS !X8).. • • • • • • • • • CMS TAESL Macro • Tape Label Processing by CMS Commands • • • • • • LABELDEF Command • End-of-Volume and End-of-Tape .122 .122.7 • 122.10 122.10 122.12 Processing • • • • 122. 13 Error Processing • 122.14 The MOVEFILE Command. • • • • •• 122 The MOVEFILE Command •• 122.14 Tapes Created by OS Utility Programs ••••••••••••••• 122 Tapes Created by OS Utility Programs ••••••• 122.15 Specifying Special Tape Handling Options • • • • • • • • • • • • Using the Remote Spooling Communications Subsystem (RSeS) .123 .123 PART 2. PROGRAM DEVELOPMENT USING CMS •• 125 SECTION 8. DEVELOPING OS PROGRAMS CMS • • • • • • • • • • • • • • • Using OS Data Sets in CMS ••••• Access Methods Supported by CMS. Using the FILEDEF Command •• Specifying the ddname •• Specifying the Device Type • • Entering File Identifications •• viii IBM VM/370: CMS User's Guide UNDER .127 .129 .130 .131 • 131 .132 ..132 Specifying CMS Tape Label Processing (5748-XX8) ................ 133 specifyIng Options •••••••••• 133 Creating CMS Files From CS Data sets •• 134 Creating CMS Piles From OS Data sets (5748-XX8). • • • • • •••••• 134.1 UsIng-CMS-Libraries. • • • • • ••• 136 The MACLIB Command •••••• _ ••• 137 Using os Macro Libraries •• _ • .140 Using OS Under CMS •••••••• 141 Assembling Programs in CMS • .143 Executing Programs • • • • • • 144 Executing TEXT Files. • • .144 TEXT LIERARIES (TXTLlBS) •••• 145 Resolving External References ••••• 146 Controlling the CMS Loader. • •• 147 Creating program Modules. • •• .149 Using EXEC procedures. • • • • • .149 SECTION 9. DEVELOPING DOS PROGRAMS UNDER CMS ••••••••••• _ ••• 151 The CMS/DCS Environment ••••••••• 151 DL/I in the CMS/DOS Environment ••••• 152 Using DOS Files on DOS Disks •••••• 154 Reading DOS Files. • • • • • • • .154 creating CMS Files from DOS Libraries.155 Using the ASSGN Command •••• _ •••• 156 Using the ASSGN Command •• 156.1 Manipulating Device Assignments •••• 157 Virtual Machine Assignments •••••• 158 Using the DLBL Command. • • • • • .159 Entering File Identifications. • .159 Using DOS Libraries in .160 The SSERV Command. • .161 The RSERV Command. • ••• _ .162 The PSERV Command. .162 The ESERV Command. • •• 163 The DSERV Command. • • .163 Using DOS Core Image Libraries •••• 164 Using Macro Libraries. • • • • • • .164 CMS MACLIBs. • • • • • • • • • • .165 Creating a CMS MACLIB. • • • • • .165 The MACLIB Command •••••••••• 166 DOS Assembler Language Macros Supported. 169 Assembling Source Prcgrams ••••••• 171 Link-editing Programs in CMS/DOS •••• 172 Linkage Editor Input ••••• _ ••• 173 Linkage Editor Output: CMS DOSLIEs •• 174 Executing Programs in CMS/DOS •••••• 175 Executing DOS Phases ••••••••• 175 Search Order for Executable Phases •• 176 Making I/O Device Assignments. • .177 Specifying a Virtual Partition Size •• 177 Setting the UPSI Byte ••••••••• 178 tebugging Programs in CMS/DOS •• _ •• 178 Using EXEC Procedures in CMS/DOS ••• 179 SECTION 10. USING ACCESS METHOD SERVICES AND VSAM UNDER eMS AND CMS/DOS • • • • • • • • • • • • • .181 Executing VSAM Programs Under CMS ••• 181 Using the AMSERV Command •••••••• 182 AMSERV Output Listings •••••••• 183 Controlling AMSERV Command Listings •• 184 Manipulating OS and DOS Disks for Use with AMSERV • • • • • • • • • • • Data and Mastercatalog sharing tisk Compatibility • • • • •• .185 •• 185 •• 186
Pg. of GC20-1819-2 Rev March 30, 1979 by SUppa SD23-9024-1 for 5748-XX8 Using VM/370 Minidisks • • .187 Using The LISTDS Command. .187 Using Temporary Disks. • .188 Defining DOS Input and output Files ••• 190 Using VSAM Catalogs •••••••••• 190 Defining and Allocating Space for VSAM files. • • • • • • • • • • .194 Using Tape Input and output •••••• 196 Defining os Input and Output Files ••• 197 Allocating Extents on OS Disks and Minidisks •••••••••••••• 198 Using VSAM Catalogs •••••••••• 199 Defining and Allocating Space for VSAM files. • • • • • • .202 Using Tape Input and output •••••• 204 Using AMSERV Under CMS ••••••••• 205 using the DEFINE and DELETE Functions.205 Using the REPRO, IMPORT, and EXPORT (or EXPORTRA/IMPORTRA) functions ••• 207 Writing EXECs for AMSERV and VSAM ••• 209 SECTION 11. HOW VM/370 CAN HELP YOU DEBUG YOUR PROGRAMS • preparing to Debug • • When a Program Abends. Resuming Execution After a Program Check • • • • • • • • • • Using DEBUG Subcommands to Monitor .211 .211 .211 .212 Program Execution ••••••••••• 213 Using Symbols with DEBUG • .214 What To Do When Your Program Loops ••• 216 Tracing Program Activity •• ")1'::' .£IV Using the CP TRACE Command •••••• 217 Using the SVCTRACE command • • .219 Using CP Debugging Commands. • .219 Debugging with CP After a Program Check. • • • • .220 Program Dumps. • • • • • • • • • • .221 Debugging Modules •••••••••••• 221 Comparison Of CP And CMS Facilities For Debugging ••••••••••••••• 222 What Your Virtual Machine Storage Looks Like.. • • • • • • • • • • .223 Shared and Nonshared Systems ••••• 223 SECTION 12. USING THE CMS BATCH FACILITY ••••• Submitting Jobs to the CMS Batch Facility ••••••••••••• Input to the Batch Machine • • How the Batch Facility Works •• preparing Jobs for Batch Execution Restrictions on CP and CMS Commands .227 .227 .227 .230 .231 in Batch Jobs •••••••••••• 232 Batch Facility Output ••• _ ••••• 232 Purging, Reordering, and Restarting Batch Jobs. • • •••••• 233 Using EXEC Files for Input to the Batch Facility. • • • • • • • • • •••• 234 Sample System Procedures for Batch Execution • • • • • .235 A Batch EXEC for a Non-CMS User •••• 236 SECTION 13. PROGRAMMING FOR THE CMS ENVIRONMENT • • • • • • • • • .239 Program Linkage. • • • • • • • .239 Return Code Handling. • ••••• 240 Parameter Lists. • • • • • • .240 Calling a CMS Command from a program •• 241 Executing Program Modules. • • •• 242 The Transient Program Area •••••• 243 eMS Macro Instructions ••••••••• 243 Macros for Disk File Manipulation ••• 244 CMS Macros for Terminal Communications. • • • • • .250 CMS Macros for Unit Record and Tape I/O • • • • • • • • • • • • ••• 250 Interruption Handling Macros .251 Updating Source Programs Using CMS ••• 251 The UPDATE Philosophy. • • • •• 252 Update Files. • • • • • • • .252 Sequencing Output Records. • •• 254 Multiple Updates •••••••••• The VMFASM EXEC Procedure. • • •• 262 PART 3. LEARNING TO USE EXEC. .••• 265 SECTION 14. BUILDING EXEC PROCEDURES •• 267 What is a Token? • • •••.•••.• 267 Variables. • • • • • • •••••• 268 Arguments. • • • • • • •••••• 272 Using the &INDEX Special Variable ••• 273 Checking Arguments. • • • • • • .274 Execution Paths in an EXEC •• 275 Labels in an EXEC Procedure. • • .275 Conditional Execution with the &IF Statement • • • .276 with the &GOTO Statement •• 277 Eranching with the &SKIP Statement •• 279 Using counters for Loop Controle e .280 LOOP Control with the SLOOP Statement.280 Nestinq EXEC procedures •••••••• 282 Exiting From EXEC Procedures _ •••• 283 Terminal Communications ••••••••• 284 Reading CMS Commands and EXEC Control Statements from the Terminal ••••• 285 Displaying Data at a Terminal ••••• 286 Reading from the Console Stack _ •••• 289 Stacking CMS Commands. • • .291 Stacking Lines for EXEC to Read •••• 292 Clearing the Console Stack .293 File Manipulation with EXECs ••• 294 Stacking EXEC Files. • • • .294 SECTION 15. USING EXECS WITH CMS COMMANDS. • • • • • • • ••••• 299 Monitoring CMS Command Execution •••• 299 Handling Error Returns From CMS Commands. • • • • • • • • • • • • .300 Using the &ERROR Contrel Statement •• 300 Using the &RETCODE Special Variable •• 301 Tailoring CMS Commands fer Your Own Use.302 Creating Your Own Default Filetypes •• 303 SECTION 16. REFINING YOUR EXEC PROCEDURES ••••••••••••••• 305 Annotating EXEC Procedures. • .305 Error Situations • • • • • • • • • • • .306 Writing Error 8essages •••••••• 306 Detugging EXEC Procedures. • •• 308 Using CMS Subset • • • • • • • • • • .308 Summary of EXEC Interpreter Logic ••• 309 SECTION 17. WRITING EDIT MACROS ••••• 311 creating Edit Macro Files. • •• 311 How Edit Macros Work •••••••••• 311 Contents ix
• • • • • • April 1, 1981 The term "CMS files" refers exclusively to files that are in the 800-byte block format used by CMS file system commands. VSAM and OS data sets and DOS files are not compatible with the CMS file format, and cannot be manipulated using CMS file system commands. The terms "disk" and "virtual disk" are used interchangeably to indicate disks that are in your CMS virtual machine configuration. Where necessary, a distinction is made between CMS-formatted disks and disks in OS or DOS format. "3270" refers to a series of display devices, namely the IBM 3275, 3276 Controller Display Station, and 32700 and 3278 Display Station, and 3277 and 3278 Display Stations. A specific device type is used only when a distinction is required between device types. Information about display terminal usaqe also applies to the IBM 3138, 3148, and 3158 Display Consoles when used in display mode, unless otherwise noted. Any information pertaining to the IBM 3284 or 3286 Printer also pertains to the IBM 3287, 3288, and 3289 printers, unless otherwise noted. "3330" refers to the IBM 3330 Disk Storage Models 1, 2, and 11, the IBM 3333 Disk Storage and Control Models 1 and 11, and the IBM 3350 Direct Access Storage in 3330 compatibility mode. "2305" refers to the IBM 2305 Fixed Head Storage, Models 1 and 2. "3340 If refers to the IB M 3340 Direct Access Storage Facility and the IBM 3344 Direct Access Storage. "3350" refers to the Access storage device nat ive mode. IBM 3350 Direct when used in • Any information pertaining to the IBM 2741 terminal also applies to the IBM 3767 terminal, unless otherwise noted. • 370x refers to the 3704/3705 Communications Controllers. For a qlossary of VM/370 terms, see the IB11 l1achine FaciliiYL.J70: ang GC20-1813. PREREQUISITE PUBLICATIONS iv IBM VM/370 CMS User's Guide If this is the first time you have used a computer terminal, you should consult the VM/370 User's GC20-1810, for information on using your terminal. If your terminal is Communications Terminal, then Operator's Gllid,g, GA18-2000, pre req uisi te. a is 3767 a The IBM virtual Machine IntroductiOn-,---GC20-180a-,-- contains an overview of the VM/370 system and its components, and lists the programs and products that are supported in CMS. COREQUISITE PUBLICATIONS The IB!1, ViI:j;J!al 1!achine· raci!i1..YilIQ: Command GC20-1818, is a companion to this user's guide. It contains complete format descriptions of the CMS commands; EDIT subcommands; EXEC control statements, built-in functions, and special variables; DEBUG subcommands; and CMS assembler language macros that are discussed or used in examples in this book. The System GC20-1808, contains the responses, error messages, and return codes issued by the CMS commands, and EDIt and subcommands referenced in this publication, as well as a complete list of the error messages issued by the EXEC processor. To use CMS, you should be familiar with the control program (CP) component of VM/370. The CP commands available to general users are described in IBM Virtual Machine Facj.liUL.J70: £f iQ£ General GC20-1820. If you are using CMS to develop programs to run under other operating systems, see IBM Machine Facilii.YL170: SYS!!U!!§ in virtual GC20-1821.
Pg. of GC20-l819-2 Rev ftarch 30, 1979 by Supp. SD23-9024-1 for 5748-118 RELATED VM/370 PUBLICATIONS Additional descriptions of various CftS functions and cOllllands that are normally used by system support personnel are described in 2y!gg, GC20-l807 2uide, GC20-1806 IPCS eftS commands are described in the IBft !U370: !nterac!!E ContrQ! GC20-1823, and not in this publication. Information describing the CftS cOllmand CPEREP, a command used to generate output reports from Vft/370's error recording records, is contained in the: Details on the operands, required are contained in: use of to make use OS/VS EREP of CPEREP, For information on OS/VS tape label processing, discussed with "Label Processing in OS Simulation" in this publication, refer to: There are three publications available as ready reference material when you use Vft/370 and CftS. They are: ill Villlli ls£!!itIL11Q: Co.mands Q§er), GX2Q-1961. GI20-1995. If you use the Remote Spooling Communications subsystem, see the IBft !s£!!!!IL37Q: Remote 2EQQliBg SubsI§te! (RSC2) GC20-1816. Assembler language program.ers may find information about the Vft/370 asseabler in Q2L!2, QQ§L!2, and Vft/37Q GC33-4010, and sBg !AL11Q Gu!de, GC33-4021. RELATED PUBLICATIONS FOR VSAft AND ACCESS ftETHOD SERVICES USERS CftS support of access method services is based on DOS/VSE and VSE/VSAft. The control statements that you can use are described in Q§!ng !2!L!SA] sng SC24-5144. Error messages produced by the access method services program, and return codes and reason codes, are listed in GC33-5379. For a detailed description of VSE/VSAft macros and macro parameters, refer to the GC24-5139. For information on OS/VS VSAft macros, refer to Q.§L!.§ !££g§§ Bet hQ.Q (is !J!) Qy!de, GC26-3818. RELATED PUBLICATIONS FOR CftS/DOS USERS The CftS ESERV command invokes the DOS/VSE ESERV program, and uses, as input, the control statements that you would use in DOS/VSE. These control statements are described in 12 the GC33-4024. Linkage editor control statements, used when invoking the DOS/VSE linkage editor under CftS/DOS, are described in Statements, GC33-5376. For information on DOS/VSE and CftS/DOS tape label processing, refer to the following publications: Labels, GC33-5374 LIQCS, !oluae SY33-8560 Preface v