home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR21 / DOCPRC13.ZIP / SAMP-DOC.ZIP / PASCAL.DOC < prev    next >
Text File  |  1992-11-16  |  30KB  |  374 lines

  1.                                                                                 
  2.                                                                                 
  3.                                                                                 
  4.                                                                                 
  5.                                                                                 
  6.                                                                                 
  7.                                                                                 
  8.                                                                                 
  9.                                                                                 
  10.                                                                                 
  11.                                                                                 
  12.                                                                                 
  13.                                                                                 
  14.                    ********************************************                 
  15.                    *                                          *                 
  16.                    *                                          *                 
  17.                    *          A STUDENT APPROACH TO           *                 
  18.                    * Pascal ON AN IBM MVS/XA OPERATING SYSTEM *                 
  19.                    *                                          *                 
  20.                    *                                          *                 
  21.                    ********************************************                 
  22.                                                                                 
  23.                                                                                 
  24.                                                                                 
  25.                                                                                 
  26.                                                                                 
  27.                                                                                 
  28.                                                                                 
  29.                                                                                 
  30.                                                                                 
  31.                                                                                 
  32.                                                                                 
  33.                                                                                 
  34.                                                                                 
  35.                                                                                 
  36.                                                                                 
  37.                                                                                 
  38.                                                                                 
  39.                                                                                 
  40.                                                                                 
  41.                                                                                 
  42.                                                                                 
  43.                                                                                 
  44.                                                                                 
  45.                                                                                 
  46.                                                                                 
  47.                                                                                 
  48.                                                                                 
  49.                                                                                 
  50.                                                                                 
  51.                                                      John S. Ward
  52.                                                        03/21/93
  53. EJECT                                                                           
  54.                                                                                 
  55.                                                                                 
  56.         In this handout we follow step-by-step instructions in creating         
  57.    a Pascal program.  Job Control Language (JCL) is used to demonstrate
  58.                                                                                 
  59.    file linkage as well as program execution.  For the purpose of this
  60.    handout, we assume you have successfully accessed the ISPF/PDF               
  61.    PRIMARY OPTION MENU shown below:                                             
  62.                                                                                 
  63.                 GEORGIA STATE UNIVERSITY COMPUTER CENTER                        
  64.     --------------------ISPF/PDF PRIMARY OPTION MENU-----------------------     
  65.    OPTION ===>                                                                  
  66.                                                            USER ID  -userid     
  67.     0  ISPF PARAMS -Specify terminal and user parameters   TIME     -14:42      
  68.     1  BROWSE      -Display source data or output listing  TERMINAL -3278       
  69.     2  EDIT        -Create or change source data           PF KEYS  -24         
  70.     3  UTILITIES   -Perform utility functions                                   
  71.     4  FOREGROUND  -Invoke language procedures in foreground                    
  72.     5  BATCH       -Submit job for language processing                          
  73.     6  COMMAND     -Enter TSO command or CLIST                                  
  74.     7  DIALOG TEST -Perform dialog testing                                      
  75.     8  LM UTILITIES-Perform library management utility functions                
  76.     C  CHANGE      -Display summary of changes for this release                 
  77.     T  TUTORIAL    -Display information about ISPF/PDF                          
  78.     X  EXIT        -Terminate ISPF using log and list defaults                  
  79.                                                                                 
  80.    Enter END command or PF3 to terminate ISPF.                                  
  81.                                                                                 
  82.                                                                                 
  83.                                                                                 
  84.    SECTION ONE: Creating your Pascal program.                                   
  85.                                                                                 
  86.                                                                                 
  87.                                                                                 
  88.     1.1) Enter 6 at the "OPTION ===>" prompt of the ISPF/PDF PRIMARY OPTION     
  89.          MENU, and hit return to go to TSO COMMAND PROCESSOR panel.             
  90.                                                                                 
  91.     1.2) Type CREATE at the cursor, and hit return.  Next, type your initials
  92.                                                                                 
  93.          when you are asked to "ENTER LIBRARY/APPLICATION NAME  ===>".  Hit
  94.          return, and type CNTL at the next prompt.  Press return one more
  95.                                                                                 
  96.          time when you see three asterisks displayed (press return anytime      
  97.                                                                                 
  98.          you see *** displayed).                                                
  99.                                                                                 
  100.     1.3) Use the F4 key to go back to the primary menu.  Then, enter 2 at       
  101.          the "OPTION ===>" prompt to go to the EDIT - ENTRY PANEL.              
  102.          Fill the sections of this panel as shown below:                        
  103.                                                                                 
  104. EJECT                                                                           
  105.    ------------------------- EDIT - ENTRY PANEL ---------------------------     
  106.    COMMAND ===>                                                                 
  107.                                                                                 
  108.    ISPF LIBRARY:                                                                
  109.       PROJECT ===> your userid                                                  
  110.       GROUP   ===> your initials     ===>           ===>         ===>           
  111.       TYPE    ===> CNTL                                                         
  112.       MEMBER  ===> program name    (Blank for member selection list)            
  113.                                                                                 
  114.    OTHER PARTITIONED OR SEQUENTIAL DATA SET:                                    
  115.       DATA SET NAME  ===>                                                       
  116.       VOLUME SERIAL  ===>          (If not catalogued)                          
  117.                                                                                 
  118.    DATA SET PASSWORD ===>          (If password protected)                      
  119.                                                                                 
  120.    PROFILE NAME      ===>          (Blank defaults to data set type)            
  121.                                                                                 
  122.                                                                                 
  123.           Hit return and you will see an empty file as shown below:             
  124.                                                                                 
  125.                                                                                 
  126.    EDIT --- User-id.Initial.CNTL(member) ------------- COLUMNS 001 072          
  127.    COMMAND ===>                                       SCROLL ===>PAGE           
  128.    ****** *********************** TOP OF DATA **************************        
  129.    ''''''                                                                       
  130.    ''''''                                                                       
  131.    ''''''                                                                       
  132.    ''''''                                                                       
  133.    ''''''                                                                       
  134.    ''''''                                                                       
  135.       .                                                                         
  136.       .                                                                         
  137.                                                                                 
  138.                                                                                 
  139.             Use the TAB key to move the cursor to any of the first six          
  140.        asterisks of the first line.  Next, type over one of those                
  141.        asterisks with an "I" (for insert), and hit return.  You can now         
  142.        enter your program.  New lines are generated every time you type a       
  143.        line and press return.  When you are finished entering your program,     
  144.        press return.  The absence of data followed by a return will stop
  145.        new lines from being generated.  You may prefer to use the example
  146.        below for practice purposes:                                             
  147.                                                                                 
  148. EJECT                                                                           
  149.    EDIT --- user-id.init.CNTL(PAS) ------------------------------ COLUMNS 001 07
  150.    COMMAND ===>                                                  SCROLL ===> PAG
  151.    ****** ************************* TO OF DATA *********************************
  152.    000100 //STEP1 EXEC PASCCLG                                                  
  153.    000200 PROGRAM TEST(INPFILE,OUTFILE);                                        
  154.    000300 TYPE                                                                  
  155.    000400   LINES = PACKED ARRAY (.1..80.) OF CHAR;                             
  156.    000500 VAR                                                                   
  157.    000600   INPFILE,OUTFILE : FILE OF LINES;                                    
  158.    000700 BEGIN                                                                 
  159.    000800   RESET(INPFILE);                                                     
  160.    000900   REWRITE(OUTFILE);                                                   
  161.    001000   WHILE NOT EOF(INPFILE) DO                                           
  162.    001100     BEGIN                                                             
  163.    001200       OUTFILE@ := INPFILE@;                                           
  164.    001300       PUT(OUTFILE);                                                   
  165.    001400       GET(INPFILE)                                                    
  166.    001500     END                                                               
  167.    001600 END.                                                                  
  168.    001700 //GO.INPFILE DD DSN=user-id.init.CNTL(input member),DISP=SHR          
  169.    001800 //GO.OUTFILE DD DSN=user-id.init.CNTL(output member),DISP=OLD         
  170.    ****** ************************* BOTTOM OF DATA *****************************
  171.                                                                                 
  172.                                                                                 
  173.                                                                                 
  174. EJECT                                                                           
  175.        The program above reads a character record of length eighty from         
  176.        an input file and writes it back to an output file.  In this             
  177.        program, the lines starting with "//" in columns one and two are         
  178.        JCL statements.  The first  statement compiles, links and executes       
  179.        the program.  The JCL statements that start with "//GO." link your       
  180.        input and output files to the program.  Note that for the input          
  181.        and output files, the clauses DISP=SHR, and DISP=OLD are used.            
  182.        This means that these files must already exist before the program        
  183.        can successfully execute.                                                
  184.                                                                                 
  185.                                                                                 
  186.                                                                                 
  187.        SECTION TWO: Creating input/output files:                                
  188.                                                                                 
  189.            To create the input file, go back to the EDIT - ENTRY PANEL          
  190.        by typing "=2" at the "COMMAND ===>" prompt of the current panel         
  191.        and pressing return.  Once you leave the current screen, your            
  192.        program is automatically saved.  In the EDIT panel, enter the name       
  193.        of your input file at the "MEMBER ===>" prompt and hit return.           
  194.        Enter your input data the same way you entered your program.             
  195.                                                                                 
  196.            Unlike the input member that must be created ahead of time,          
  197.        the member for the output data is created when the program is            
  198.        executed.  However the data set that houses the output member must       
  199.        already exist before the program is executed.  You have already          
  200.        constructed this data set when you used the CREATE command.              
  201.                                                                                 
  202.                                                                                 
  203.                                                                                 
  204.                                                                                 
  205.    SECTION THREE: Executing your Pascal program.                                
  206.                                                                                 
  207.                                                                                 
  208.                                                                                 
  209.      3.1) To execute your program, enter =2 at the "COMMAND ===>" prompt.       
  210.           Press return to go to the EDIT - ENTRY PANEL.                         
  211.                                                                                 
  212.                                                                                 
  213.      3.2) Enter the name of your Pascal program at the "MEMBER ===>"            
  214.           prompt.  Press return and your program will be displayed at           
  215.           the terminal.                                                         
  216.                                                                                 
  217.      3.3) Enter the command "SUBT A,10" at the "COMMAND ===>" prompt of         
  218.           this panel and press return to submit your program to the system.     
  219.           The operating system assign a jobname comprised of your userid        
  220.           suffixed with the letter A followed by a job number.  The response    
  221.           from the operating system will resemble the lines below:              
  222.                                                                                 
  223.           IKJ56250I JOB useridA(JOBnumber) SUBMITTED                            
  224.           ***                                                                   
  225.           Memorize the number inside the parentheses.                           
  226.                                                                                 
  227.                                                                                 
  228.                                                                                 
  229. EJECT                                                                           
  230.           SECTION FOUR : Accessing your output:                                 
  231.                                                                                 
  232.      4.1) At the "COMMAND ===>" prompt, type =3.8 to go to OUTLIST UTILITY      
  233.           PANEL.                                                                
  234.                                                                                 
  235.                                                                                 
  236.                                                                                 
  237.    -------------------- OUTLIST UTILITY ----------------------------------      
  238.    OPTION ===>                                                                  
  239.                                                                                 
  240.       L - List job name/id's via the TSO STATUS command                         
  241.       D - Delete job output from SYSOUT hold queue                              
  242.       P - Print job output and delete from SYSOUT hold queue                    
  243.       R - Requeue job output to a new output class                              
  244.       blank - Display job output                                                
  245.                                                                                 
  246.    FOR JOB TO BE SELECTED:                                                      
  247.       JOBNAME ===> Userid                                                       
  248.       CLASS   ===>                                                              
  249.       JOBID   ===> J01977                                                       
  250.                                                                                 
  251.    FOR JOB TO BE REQUEUED:                                                      
  252.       NEW OUTPUT CLASS ===>                                                     
  253.     * DESTINATION      ===>                                                     
  254.                                                                                 
  255.    FOR JOB TO BE PRINTED:               (A for ANSI)                            
  256.       PRINTER CARRIAGE CONTROL ===>     (M for machine)                         
  257.                                         (blank for none)                        
  258.        * - Georgia State University Enhancement                                 
  259.           Press return to see your output.                                      
  260.                                                                                 
  261.                                                                                 
  262.      4.2) Use the TAB key to tab to the "JOBNAME ===>" prompt.  Here, type      
  263.           your userid, followed by the letter "A" (or the jobname suffix        
  264.           entered earlier).                                                     
  265. EJECT                                                                           
  266.      4.3) Next, tab down to the "JOBID ===>" prompt, and type the letter "J     
  267.           followed by the job number you memorized earlier.  Then, hit          
  268.           return to see your job output.  To scroll down, use the F8 key,       
  269.           and to scroll up, use the F7 key.  To scroll left and right,          
  270.           use the F10, and F11 keys respectively.                               
  271.           Below is a similar facsimile of a successful Pascal execution a       
  272.           viewed from the OUTLIST UTILITY menu.                                 
  273.                                                                                 
  274.    BROWSE - USGHND.DAY.SPF235.OUTLIST ------------ LINE 000000 COL 001 080      
  275.    COMMAND ===>                                            SCROLL ===>HALF      
  276.    ********************************** TOP OF DATA ************************      
  277.    1                    J E S 2  J O B  L O G  --  S Y S T E M  G S U 1  --  N O
  278.    0                                                                            
  279.     11.12.36 JOB 2185  ICH70001I USGHND   LAST ACCESS AT 11:09:25 ON TUESDAY, OC
  280.     11.12.36 JOB 2185  $HASP373 USGHNDX  STARTED - INIT  A - CLASS A - SYS GSU1 
  281.     11.12.45 JOB 2185  -                                                --TIMING
  282.     11.12.45 JOB 2185  -JOBNAME  STEPNAME PROCSTEP    RC   EXCP   CONN    CPU   
  283.     11.12.45 JOB 2185  -USGHNDX  PASC                      00   332   1851    .0
  284.    0                                                                            
  285.     11.12.45 JOB 2185  -USGHNDX  LKED                 00    332   1851    .00   
  286.     11.12.45 JOB 2185  -USGHNDX  GO                   00    332   1851    .00   
  287.     11.12.45 JOB 2185  -USGHNDX  ENDED.  NAME-USGHND  /\       TOTAL CPU TIME=  
  288.     11.12.46 JOB 2185  $HASP395 USGHNDX  ENDED        ||                        
  289.    0------ JES2 JOB STATISTICS ------                 ||                        
  290.    - 18 OCT 88 JOB EXECUTION DATE                     ||-------------------     
  291.    -         9 CARDS READ                             | A RETURN CODE (RC)      
  292.    -       152 SYSOUT PRINT RECORDS                   | OF ZERO MEANS YOUR      
  293.    -         0 SYSOUT PUNCH RECORDS                   | PROGRAM EXECUTED        
  294.    -         8 SYSOUT SPOOL KBYTES                    | WITHOUT ERRORS.         
  295.    -      0.17 MINUTES EXECUTION TIME                 |                         
  296.        1     //USGHNDX   JOB I994998,USGHND,          |--------------------     
  297.              //     NOTIFY=USGHND,CLASS=A,MSGLEVEL=(1,1),                       
  298.              //     USER=USGHND,TIME=(0,5)                                      
  299.                                                                                 
  300.                                                                                 
  301.                                                                                 
  302.      4.4) To look at your output file, type =2 at the "COMMAND ===>" prompt     
  303.           When you are in the EDIT - ENTRY PANEL, type the name of your         
  304.           output file (OUTDATA in our case) in the "TYPE ===>" prompt.          
  305.           Then, hit return to see your output file.                             
  306.                                                                                 
  307.    SECTION FIVE: Logging off.                                                   
  308.                                                                                 
  309.                                                                                 
  310.           To logoff, enter =X at the "COMMAND ===>" or "OPTION ===>"            
  311.           prompt of any panel.  Once the operating system displays the
  312.           message READY, you may then type the command LOGOFF.
  313.           At this point you will be disconnected from the system.
  314.                                                                                 
  315.    IMPORTANT NOTE:                                                              
  316.                                                                                 
  317.           The program, input and output files that you have created are         
  318.           saved in the system.  Therefore subsequent executions should          
  319.           reference sections 3.1 through 4.4.                                   
  320.                                                                                 
  321. EJECT                                                                           
  322.                                                                                 
  323.                     COMMONLY USED FEATURES OF THE FILE EDITOR                   
  324.                                     ISPF/PDF                                    
  325.                                                                                 
  326.       PROGRAM                                                                   
  327.    FUNCTION KEYS               NOTE: The more frequently used keys have         
  328.                                      been marked with an asterisk               
  329.      F1     HELP                                                                
  330.      F2     SPLIT SCREEN                                                        
  331.    * F3     END                                                                 
  332.      F4     RETURN                                                              
  333.      F5     RFIND                                                               
  334.      F6     RCHANGE                                                             
  335.    * F7     UP SCREEN                                                           
  336.    * F8     DOWN SCREEN                                                         
  337.      F9     SWAP                                                                
  338.    * F10    LEFT SCREEN                                                         
  339.    * F11    RIGHT SCREEN                                                        
  340.      F12    CURSOR                                                              
  341.                                                                                 
  342.    ------------------------------------------------------------------------     
  343.                                                                                 
  344.                                                                                 
  345.       ISPF/PDF                                                                  
  346.        MENUS                                                                    
  347.                                                                                 
  348.    * =2     EDIT                                                                
  349.      =3.1   DELETE MEMBERS                                                      
  350.      =3.2   DELETE DATA SETS                                                    
  351.      =3.4   GET LISTING OF ALL DATA SETS                                        
  352.      =3.6   GET PROGRAMS OF DATA FILES SENT TO PRINTER                          
  353.    * =3.8   DISPLAY OR PRINT JOB OUTPUT                                         
  354.                                                                                 
  355.    * =X     EXIT OR LOGOFF SYSTEM   (then type: logoff)                         
  356.                                                                                 
  357.                                                                                 
  358.    ------------------------------------------------------------------------     
  359.                                                                                 
  360.                       KEYBOARD NOTES                                            
  361.                                                                                 
  362.    *****      WHENEVER PROMPTED WITH '***' PRESS RETURN         *****           
  363.    *****      IF PROMPTED WITH "READY" TO GET BACK ON THE       *****           
  364.    *****      SYSTEM TYPE "ICF", OR IF YOU ARE FINISHED         *****           
  365.    *****      TYPE "LOGOFF".                                    *****           
  366.                                                                                 
  367.    *****      IF KEYBOARD FREEZES, PRESS THE TAB KEY            *****           
  368.    *****      IF STILL FROZEN, PRESS THE return key             *****           
  369.    *****      IF STILL FROZEN, PRESS CNTL G                     *****           
  370.    *****      IF KEYBOARD IS STILL LOCKED UP, PRESS ALT 2       *****           
  371.    *****      IF KEYBOARD IS STILL LOCKED UP, PRESS ALT 1       *****           
  372.                                                                                 
  373.    ------------------------------------------------------------------------     
  374.