1 / 41

Creating Executable Programs on the Mainframe

Creating Executable Programs on the Mainframe. Tuesday, January 20, 2009. Lecture Overview. Program execution components JCL COBOL SDSF Compiling and executing Lab 1c Batch and online modes Checking output Viewing/debugging errors. Example: Compile/Execution Structure. JDK

caesar
Download Presentation

Creating Executable Programs on the Mainframe

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating Executable Programs on the Mainframe Tuesday, January 20, 2009 Lecture 3

  2. Lecture Overview • Program execution components • JCL • COBOL • SDSF • Compiling and executing • Lab 1c • Batch and online modes • Checking output • Viewing/debugging errors Lecture 3

  3. Example: Compile/Execution Structure JDK (compiler) JRE (executes) Java Source Byte Code Output Lecture 3

  4. Other COBOL Programs SDSF COBOL Source JCL Load Module Creates Copy Libraries Can be in the same JCL JCL (executes load module) Files Program Execution Components Lecture 3

  5. Lecture 3

  6. Lecture 3

  7. Lecture 3

  8. Lecture 3

  9. The “JOB” Statement The JOB statement must be the first statement in a job. It supplies a job name to identify the job, along with accounting information and various options that affect how the job is processed. • //MM01P JOB (36512),'A PRINCE',NOTIFY=&SYSUID • //STEP1 EXEC PGM=IEBGENER • //SYSPRINT DD SYSOUT=* • //SYSUT1 DD DSN=MM01.COPYLIB.COBOL(CUSTMAST),DISP=SHR • //SYSUT2 DD SYSOUT=* • //SYSIN DD DUMMY Lecture 3

  10. The “EXEC” Statement The EXEC statement identifies the program or procedure to be executed in the job step. It can have a step name in the name field. • //MM01P JOB (36512),'A PRINCE',NOTIFY=&SYSUID • //STEP1 EXEC PGM=IEBGENER • //SYSPRINT DD SYSOUT=* • //SYSUT1 DD DSN=MM01.COPYLIB.COBOL(CUSTMAST),DISP=SHR • //SYSUT2 DD SYSOUT=* • //SYSIN DD DUMMY Lecture 3

  11. The “DD” Statement • The DD statement allocates the data sets required by the program or procedure. The ddname in the name field must be the same as the one that’s used in the program or procedure. • You typically code the DD statement for a printer file using the SYSOUT = * format. Then, the output is processed based on the default output class or the output class you specify in the MSGCLASS parameter of the JOB statement. • You can specify a dummy data set by coding the DUMMY parameter on its DD statement. • //MM01P JOB (36512),'A PRINCE',NOTIFY=&SYSUID • //STEP1 EXEC PGM=IEBGENER • //SYSPRINT DD SYSOUT=* • //SYSUT1 DD DSN=MM01.COPYLIB.COBOL(CUSTMAST),DISP=SHR • //SYSUT2 DD SYSOUT=* • //SYSIN DD DUMMY Lecture 3

  12. Lecture 3

  13. Lecture 3

  14. Lecture 3

  15. Lecture 3

  16. Lecture 3

  17. Lecture 3

  18. Lecture 3

  19. SDSF - Status Lecture 3

  20. SDSF - Owner Lecture 3

  21. SDSF – Select Job Lecture 3

  22. SDSF – View Output Lecture 3

  23. Lecture 3

  24. Lecture 3

  25. Lecture 3

  26. Lab 1c • Compile, link and run a “Hello World” Cobol application. • Create/Run the program using JCL. • Run the program in Batch and online (TSO) modes • Step 1: Create 3 PDSs: • Create a data set for the cobol program: xxx.HELLO.COBOL • Create a data set for the the JCL to compile/run the program: xxx.HELLO.JCL • Create a data set for the resulting executable: xxx.HELLO.LOAD • (where ‘XXX’ is your User Id) Lecture 3

  27. Lab 1c - COBOL • Step 2: • Create the source code “Hello World” Cobol example: xxx.HELLO.COBOL(FIRST) • This would be done using ISPF. Note that the line numbers are created/updated automatically Lecture 3

  28. Lab 1c - Cobol Program Lecture 3

  29. Lab 1c - JCL • STEP 3: Create the JCL used to compile/link/run the hello world example. • It should be in the JCL PDS: XXX.HELLO.JCL(COMPILE) Lecture 3

  30. Lab 1c - JCL Lecture 3

  31. Lab 1c – Execute (Batch) • STEP 4: Execute the JCL – from within ISPF (when editing the JCL), enter the command ‘submit’ on the command line (aka the line that has “Command ===>” ) • STEP 5: View the results from executing the JCL. From the top level in ISPF: • Execute command 13 (SDSF). • Select O (to view output from the batch job). • You can Filter based on owner (your account id), • You should be able to see the output “MYHELLO” – that was the name of the JOB (you can see this in the JCL). • To view the output, one would enter an “?” in the left column prior to the name of the output. This will show the different “tasks in the JCL. • Then to see the actual output, enter a “s” next to the output you want to view (Hint: Look at the “GO” output) Lecture 3

  32. Lab 1c – Execute (TSO) • STEP 6: Execute using TSO • (Using ISPF “command” - 6) • ALLOCATE DDNAME(SYSOUT) DSNAME(*) • ALLOCATE DDNAME(SYSIN) DSNAME(*) • CALL ’xxx.HELLO.LOAD(FIRST)' Lecture 3

  33. Lecture 3

  34. Lecture 3

  35. Lecture 3

  36. Lecture 3

  37. Lecture 3

  38. Lecture 3

  39. Lecture 3

  40. Lecture 3

  41. Lecture 3

More Related