The Lightsabre Project ====================== Part 001 - Checking the Development Environment Right then. Before I start building anything, I'd better make sure I've got all the bits, and that those bits are going to do the job. As it's the first progress report, and also because I've not done anything on MVS in my gopherhole yet, I'll include some short explanations of what's going on. COBOL and assembler is what I'm going to use, so I'll be needing: 1. A COBOL compiler 2. An assembler Fairly straightforward. 'Hello world' is plenty good enough here. COBOL Hello World ----------------- Whacked this into the editor and saved it away into the LEE.TEST.COBOL dataset as member HELLO. IDENTIFICATION DIVISION. PROGRAM-ID. HELLO. PROCEDURE DIVISION. 000-MAIN. DISPLAY "Hello, World!". STOP RUN. Compiling and Running --------------------- JCL. Oh yeah. Here we go. Proper mainframing. JCL is how batch jobs are submitted for execution in MVS. Just another file in an editor. This time it's in LEE.TEST.CNTL(HELLOCLG). //LEECLG JOB ,'LEE',CLASS=A,MSGCLASS=H,MSGLEVEL=(1,1) //STEP1 EXEC PROC=IGYWCLG,PARM.COBOL='XREF,FLAG(I,E)' //COBOL.SYSIN DD DSN=LEE.TEST.COBOL(HELLO),DISP=SHR //GO.SYSOUT DD SYSOUT=* This will create a job called LEECLG and runs the IGYWCLG procedure, which is an IBM-supplied procedure for running the COBOL compiler. The 'CLG' in this case means 'Compile Link Go' ie. compile, link and run the generated binary. The COBOL.SYSIN bit is, as you may have guessed, the input to the job. In this case, the COBOL source. This job is submitted to the system from the editor, and it'll get executed as soon as the system can do it. Output should be in the spool: LEECLG JOB00567 LEE 1 PRINT A 133 And there it is. Let's check what's what. The job output consists of: JESMSGLG JES2 2 LEE H LOCAL 17 JESJCL JES2 3 LEE H LOCAL 60 JESYSMSG JES2 4 LEE H LOCAL 62 SYSPRINT STEP1 COBOL 101 LEE H LOCAL 98 SYSPRINT STEP1 LKED 102 LEE H LOCAL 124 SYSOUT STEP1 GO 106 LEE H LOCAL 1 The JES* output is from the spooler. The SYSPRINT output is the output from both the compiler (COBOL) and the link editor (LKED). The SYSOUT output contains the output from our program (the GO step): ********************************* TOP OF DATA ********************************** Hello, World! ******************************** BOTTOM OF DATA ******************************** Success! Assembler Hello World --------------------- Next, assembler source to do a simiar job to the COBOL: * HELLO WORLD HELLO START 0 BEGIN SAVE (14,12) BALR 3,0 USING *,3 ST 13,SAVE+4 LA 13,SAVE OPEN (PRTOUT,OUTPUT) PUT PRTOUT,HELLOTXT CLOSE (PRTOUT) L 13,SAVE+4 RETURN (14,12) * PRTOUT DCB DSORG=PS, RECFM=F, MACRF=PM, BLKSIZE=132, LRECL=132, DDNAME=PRTOUT * HELLOTXT DC CL133'HELLO WORLD!' SAVE DS 18F END BEGIN Assembling and Running ---------------------- And some JCL to perform a similar assemble-link-go: //LEEASCLG JOB ,'LEE',CLASS=A,MSGCLASS=H,MSGLEVEL=(1,1) //STEP1 EXEC ASMACLG //SYSIN DD DSN=LEE.TEST.ASM(HELLO),DISP=SHR //SYSPRINT DD SYSOUT=H //G.PRTOUT DD SYSOUT=* // So, submit the JCL, and check the spool for output: LEEASCLG JOB00579 LEE 1 PRINT A 135 OK, the job's run and put *something* in the spool at least. Let's check it out: JESMSGLG JES2 2 LEE H LOCAL 17 JESJCL JES2 3 LEE H LOCAL 45 JESYSMSG JES2 4 LEE H LOCAL 54 SYSPRINT STEP1 C 101 LEE H LOCAL 193 SYSPRINT STEP1 L 102 LEE H LOCAL 150 PRTOUT STEP1 G 103 LEE H LOCAL 1 Pretty similar to the COBOL. In this case, the output should be in the PRTOUT file: ********************************* TOP OF DATA ********************************** HELLO, WORLD! ******************************** BOTTOM OF DATA ******************************** Lovely. Looks like the COBOL compiler and the assembler are both working OK, and I've got my JCL sorted so I can use them. Unfortunately, this means I've no excuse not to get cracking on the actual work...