Saturday, December 7, 2013

Day-17.

Sub File-Load All:

 Overview:
This module enables the student to understand the concept of Sub File.
 Outline:
Topics covered,
·         Load All Subfile
·         Multiple Addition of Records
·         Multiple Updation of Records
·         Multiple Deletion Records

 Objective:
By the end of this module, the student should be able to do:
  • Display Multiple of Records
  • Multiple Addition of Records
  • Multiple Updation of Records
  • Multiple Deletion Records
 Sub File:
 A Sub File is a group of records that are read from or written to display device in one operation.
Keyword Related to Load All Sub File:

  1. SFL: Record level keyword that specifies the subfile record format.
  1. SFLCTL: Record level keyword, which specifies the subfile control record format. It controls functions like display, clearing & initialization.
  1. SFLDSP: This keyword is mandatory and displays the subfile when the RPG/400 program issues an output operation.
  2. SFLDSPCTL: This is control record level and mandatory keyword. Displays control record format and enables SFLDSP. The fields or literals from the control record format are displayed one time, as headings, before the list of subfile records.
5. SFLCLR: Clears a subfile of all records before first page of subfile loads. An option indicator is required for this keyword, or the system would clear the subfile on every output operation to the control record. The indicator often is the reverse of the indicator used SFLDSP and SFLDSPCTL, so that you clear the subfile in one output operation and display the subfile and the control-record information in second output operation.

6. SFLEND: This keyword displays a plus sign in the lower right corner of the screen. The plus sign indicates that subfile contains some more records that can be displayed on the screen. The plus sign will not be displayed if subfile is at end. An indicator should condition this keyword. When the indicator causes SFLEND to be in effect, The system does not display a plus sign. Thus, the program should turn on the indicator for SFLEND,and disable PAGEDOWN with the opposite indicator when no additional matching records remain to be put into the subfile.

  1. SFLSIZ: A control record level and mandatory keyword, which specifies the number of records that may be loaded in the subfile. This value should be either to or greater than the SFLPAG value. Maximum no of records that can be loaded in a subfile is 9,999.
  1. SFLPAG: This is a record level and mandatory keyword for control record format, it specifies the number of records that may be displayed on screen at a time. The number follows the keywords and is enclosed in parentheses. You typically determine this number by calculating the number of available screen lines, after taking into account all other lines to be displayed along with the subfile.

READC (Read Change Record)

The READC reads the change records. It is used in the sub files.

Factor 1

    

Factor 2

Record Name (Mandatory)

Result Field


HI


LO

  

EQ

EQ













Step1: First Create a Physical File


DDS Of Physical File:

DDS Of Physical File:

Columns . . . :    1  71           Browse                       PB01U01D/MYDDS
 SEU==>                                                                    EMP1
 FMT A* .....A*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
        *************** Beginning of data *************************************
0000.01       *****************************************************************
0000.02       *                                                                
0000.03       *          EMLPOYEE DETAILS                                       
0000.04       *                                                                
0000.05       *****************************************************************
0003.00      A          R EMP1R                                                 
0004.00      A             EMPNO          3  0      COLHDG('EMPLOYEE ID')      
0005.00      A             ENAME        10          COLHDG('EMPLOYEE NAME')    
0006.00      A             EGRAD           2          COLHDG('EMPLOYEE GRADE')   
0007.00      A         K EMPNO                                                
        ****************** End of data ****************************************
                                                                               
                                                                                                                                                
                                                                               
 F3=Exit   F5=Refresh   F9=Retrieve   F10=Cursor   F11=Toggle   F12=Cancel     
 F16=Repeat find        F24=More keys                                           
                                         (C) COPYRIGHT IBM CORP. 1981, 2002.   



Step 2: Create Display File

  1. Type STRSDA in Command Prompt, then press enter
  1. Type ‘1’, press enter

                                                            Design Screens                                 
                                                                               
 Type choices, press Enter.                                                    
                                                                                
   Source file . . . . . . . .   MYDDS        Name, F4 for list                
                                                                               
     Library . . . . . . . . .   PB01U01D     Name, *LIBL, *CURLIB             
                                                                               
   Member  . . . . . . . . . .   SUBFIl       Name, F4 for list                
                                                                                
                                                                                                                                                         
                                                                               
 F3=Exit     F4=Prompt     F12=Cancel                                           
                                                                           


  1. Write the name of Source File, Library, and member then, Press Enter following Screen appear
                                                         Work with Display Records                                
                                                                               
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl     
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                               
 Type options, press Enter.                                                    
   1=Add             2=Edit comments          3=Copy          4=Delete         
   7=Rename          8=Select keywords       12=Design image                   
                                                                               
 Opt  Order    Record        Type      Related Subfile   Date        DDS Error 
                                                                                
                                                                               
   (No records in file)                                                        
                                                                                
                                                                               
                                                                                                                                                        
                                                                         Bottom
 F3=Exit                     F12=Cancel      F14=File-level keywords           
 F15=File-level comments     F17=Subset      F24=More keys                     
                                                                               
  1. Type ‘1’ in Opt , then press enter following Screen appear
                                                     Add New Record                                  
                                                                                
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl     
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                                
 Type choices, press Enter.                                                    
                                                                               
   New record  . . . . . . . . . . . . . . .   SUB          Name               
                                                                               
   Type  . . . . . . . . . . . . . . . . . .   SFL          RECORD, USRDFN     
                                                                   SFL,    SFLMSG     
                                                                   WINDOW, WDWSFL     
                                                                    PULDWN, PDNSFL     
                                                                    MNUBAR             
                                                                               
                                                                                                                                                        
                                                                               
 F3=Exit     F5=Refresh     F12=Cancel                                         
                                                                               

  1. Write ‘SUB’ in the New record, write ‘SFL’ in the Type and then press Enter. 

                                                       Add New Record                                  
                                                                                
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl     
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                                
 Type choices, press Enter.                                                    
                                                                               
   New record  . . . . . . . . . . . . . . .   SUB          Name               
                                                                               
   Type  . . . . . . . . . . . . . . . . . .   SFL        RECORD, USRDFN     
                                                                 SFL,    SFLMSG     
                                                                 WINDOW, WDWSFL     
                                                                  PULDWN, PDNSFL     
                                                                  MNUBAR              
   Subfile control record  . . . . . . . . .   SUBCTL       Name               
                                                                               
                                                                                              
 F3=Exit     F5=Refresh     F12=Cancel                                         
                                                  

  1. Write ‘SFLCTL’ in the Subfile control record field, and press Enter

                                                                Add New Record                                  
                                                                               
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl     
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                               
 Type choices, press Enter.                                                    
                                                                               
   New record  . . . . . . . . . . . . . . .   SUB          Name               
                                                                                
   Type  . . . . . . . . . . . . . . . . . .   SFL      RECORD, USRDFN     
                                                               SFL,    SFLMSG     
                                                               WINDOW, WDWSFL     
                                                               PULDWN, PDNSFL     
                                                               MNUBAR             
   Subfile control record  . . . . . . . . .   SFLCTL       Name               
                                                                               
                                                                                              
                                                                                
 F3=Exit     F5=Refresh     F12=Cancel                                         
                                                                               

  1. Again Press enter

                                                              Select Subfile Keywords                            
                                                                               
 Subfile record . . . . . . . :   SUB                                          
                                                                                
 Type choices, press Enter                                                     
                                                                               
                                     Y=Yes                                     
   General keywords  . . . . . . . .                                           
   Indicator keywords  . . . . . . .                                          
                                                                                
                                                                               
   TEXT keyword  . . . . . . . . . .                                           
                                                                              
                                                                               
                                                                               
 F3=Exit   F4=Display Selected Keywords                                        
                                                                               


  1. Write ‘Y’ in the fields General keywords, Subfile display layout, Subfile messages and Select record keywords, and then Press enter

                                                         Select General Keywords                            
                                                         Select Subfile Control Keywords                        
                                                                                
 Subfile control record . . . . . . . . . :   SFLCTL                           
                                                                               
 Type choices, press Enter.                                                     
                                                                               
                                     Y=Yes                                     
   General keywords  . . . . . . . .   Y                                       
   Subfile display layout  . . . . .   Y                                       
   Subfile messages  . . . . . . . .   Y                                       
                                                                               
   Select record keywords  . . . . .   Y                                       
                                                                               
   TEXT keyword  . . . . . . . . . .                                           
                                                                                
                                                                                                    
 F3=Exit   F4=Display Selected Keywords   F12=Cancel                           
                                                                                

  1. Define The indicator’s as it shown in the Screen, and press enter

                                                      Define General Keywords                            
                                                                               
 Subfile control record . . . . . . . . . :   SFLCTL                           
                                                                               
 Type choices, press Enter.               Keyword                              
   Related subfile record . . . . . . .      SFLCTL     SUB          Name         
   Subfile cursor relative record . . .   SFLCSRRRN               Name         
   Subfile mode . . . . . . . . . . . .         SFLMODE                 Name         
                                                                                
                                                                               
                                                                               
                                                     Y=Yes        Indicators/+ 
   Display subfile records  . . . . . .   SFLDSP       Y          80           
   Display control record . . . . . . .   SFLDSPCTL    Y          81           
   Initialize subfile fields  . . . . .   SFLINZ                                
   Delete subfile area  . . . . . . . .   SFLDLT                               
   Clear subfile records  . . . . . . .   SFLCLR                  82           
   Indicate more records  . . . . . . .   SFLEND                  83           
     SFLEND parameter   . . . . . . . .     *MORE      Y                       
     SFLEND parameter   . . . . . . . .     *SCRBAR                 *MORE ...  
   Record not active  . . . . . . . . .   SFLRNA                               
                                                                   More...     
 F3=Exit   F12=Cancel                                                          
                                                                               


  1. Write the SFLSIZ value and SFLPAG value and press enter

                                                             Define Display Layout                             
                                                                               
 Subfile control record . . . . . . . . . :   SFLCTL                            
                                                                               
 Type values, press Enter.                                                     
                                                                                
                                            Keyword  Number                    
   Records in subfile . . . . . . . . . .   SFLSIZ    9999                      
     Program-to-system field  . . . . . .                                      
                                                                                
   Records per display  . . . . . . . . .   SFLPAG      5                      
                                                                               
   Spaces between records . . . . . . . .   SFLLIN                             
                                                                               
                                                                                                
                                                                                
 F3=Exit   F12=Cancel                                                          
                                                                               

  1. Again Press Enter
                                                      Define Subfile Messages                            
                                                                               
 Subfile control record . . . . . . . . . :   SFLCTL                           
                                                                                
 Type values, press Enter.                                                     
                                                                               
   Indicators/+    SFLMSG - Message Text                             More  Ind 
                                                                               
                                                                                         
                                                                               
                                                                         Bottom
                                                                                
                                                                               
   Indicators/+    SFLMSGID  File         Library     Ind   Name               
                                                                                
                                                                                             
                                                                               
                                                                         Bottom
 F3=Exit   F12=Cancel                                                           
                                                                               


  1. Again Press Enter two times (Here We can select particular keyword by putting ‘Y’ in front of that keyword option)

                                                         Select Record Keywords                             
                                                                               
 Record . . . :   SFLCTL                                                       
                                                                                
 Type choices, press Enter.                                                    
                                                                               
                                     Y=Yes                                      
   General keywords  . . . . . . . .                                           
   Indicator keywords  . . . . . . .                                           
   Application help  . . . . . . . .                                            
   Help keywords . . . . . . . . . .                                           
   Output keywords . . . . . . . . .                                           
   Input keywords  . . . . . . . . .                                           
   Overlay keywords  . . . . . . . .                                           
                                                                               
   Print keywords  . . . . . . . . .                                           
   ALTNAME keyword . . . . . . . . .                                           
                                                                               
   TEXT keyword  . . . . . . . . . .                                           
                                                                                
                                                                               
                                                                               
 F3=Exit   F4=Display Selected Keywords   F12=Cancel                           
                                                                               

  1. Type ‘12’ in opt to design the header in the SFLCTL (record), and press Enter

                                                            Work with Display Records                                 
                                                                               
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl     
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                               
 Type options, press Enter.                                                    
   1=Add             2=Edit comments          3=Copy          4=Delete         
   7=Rename          8=Select keywords       12=Design image                   
                                                                               
 Opt  Order    Record        Type      Related Subfile   Date        DDS Error 
                                                                                
         10    SUB           SFL                         03/24/05              
 12      20    SFLCTL        SFLCTL    SUB               03/24/05              
                                                                                
                                                                                                
                                                                                
                                                                         Bottom
 F3=Exit                     F12=Cancel      F14=File-level keywords           
 F15=File-level comments     F17=Subset      F24=More keys                      
                                           

  1. Design the Control Format As Shown then Press F3 and Save the control format of sub file 
UUUUUUUUUU                                                                                 DD/DD/DD 
                                                LOAD ALL SUBFILE                         TT:TT:TT 
                                                                               
 ----------------------------------------------------------------------------- 
                                                                                
          EMP NO.               EMP NAME               EMP GRADE               
                                                                               
 ------------------------------------------------------------------------------
                                                                              








                                                                              

  1. Type ‘12’ in opt to design the Record format of the Subfile, and press Enter
                                            Work with Display Records                                
                                                                                
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl     
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                                
 Type options, press Enter.                                                    
   1=Add             2=Edit comments          3=Copy          4=Delete         
   7=Rename          8=Select keywords       12=Design image                    
                                                                               
 Opt  Order    Record        Type      Related Subfile   Date        DDS Error 
                                                                               
 12      10    SUB              SFL                                  03/24/05              
           20    SFLCTL        SFLCTL    SUB               03/24/05              
                                                                               
                                                                                
                                                                                   
                                                                         Bottom
 F3=Exit                     F12=Cancel      F14=File-level keywords           
 F15=File-level comments     F17=Subset      F24=More keys                     
                                           

  1. Design the Sub File Record format As Shown then Press F3 and Save

UUUUUUUUUU                                                                              DD/DD/DD 
                                                 LOAD ALL SUBFILE                     TT:TT:TT 
                                                                                
 ----------------------------------------------------------------------------- 
                                                                               
         EMP NO.               EMP NAME               EMP GRADE               
                                                                               
 ------------------------------------------------------------------------------
             999-                  BBBBBBBBBB              BB                      
             999-                  BBBBBBBBBB              BB                     
             999-                  BBBBBBBBBB              BB                     
             999-                  BBBBBBBBBB              BB                      
             999-                  BBBBBBBBBB              BB                     
                                                                               
                                                         
                                                                               
                                                                               

  1. Type ‘1’ in opt to add Footer in the sub file , and press Enter
                                                Work with Display Records                                
                                                                               
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl      
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                               
 Type options, press Enter.                                                    
   1=Add             2=Edit comments          3=Copy          4=Delete         
   7=Rename          8=Select keywords       12=Design image                   
                                                                               
 Opt  Order    Record        Type      Related Subfile   Date        DDS Error 
  1                                                                             
             10      SUB           SFL                                03/24/05              
             20      SFLCTL     SFLCTL    SUB             03/24/05              
                                                                               
                                                                                 
                                                                               
                                                                         Bottom
 F3=Exit                     F12=Cancel      F14=File-level keywords            
 F15=File-level comments     F17=Subset      F24=More keys                     
                                           

  1. Write ‘FOOTER’ in the New Record and write ‘RECORD’ in the Type. Then Press Enter 
                                                        Add New Record                                  
                                                                                 
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl      
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                               
 Type choices, press Enter.                                                    
                                                                                
   New record  . . . . . . . . . . . . . . .   FOOTER       Name               
                                                                               
   Type  . . . . . . . . . . . . . . . . . .   RECORD    RECORD, USRDFN     
                                                                      SFL,    SFLMSG     
                                                                      WINDOW, WDWSFL     
                                                                       PULDWN, PDNSFL     
                                                                      MNUBAR             
                                                                                       
                                                                               
                                                                               
 F3=Exit     F5=Refresh     F12=Cancel                                          
                                                                               

  1. Design the FOOTER as Shown then Press F3 and Save
                                                                               
                                                                               
                                                                               
                                                                               
                                                                                
                                                                               
                                                                                                                                                 
                                                                               
                                                                                
                                                                               
 ------------------------------------------------------------------------------
                                                                                
                                                                               
    F2=UPDATE  F3=EXIT                                                                  
                                                                               
                                                                               

  1. Type ‘8’ in opt field of the SFLCTL, then Press enter

                                             Work with Display Records                                
                                                                                
 File  . . . . . . :   MYDDS                  Member . . . . . . :   SUBFIl      
   Library . . . . :     PB01U01D             Source type  . . . :   DSPF      
                                                                                
 Type options, press Enter.                                                    
   1=Add             2=Edit comments          3=Copy          4=Delete         
   7=Rename          8=Select keywords       12=Design image                   
                                                                               
 Opt  Order    Record        Type      Related Subfile   Date        DDS Error 
                                                                                
            10      SUB            SFL                              03/24/05              
  8        20      SFLCTL     SFLCTL    SUB            03/24/05              
            30      FOOTER    RECORD                      03/24/05              
                                                                                
                                                                               
                                                                      
                                                                         Bottom
 F3=Exit                     F12=Cancel      F14=File-level keywords           
 F15=File-level comments     F17=Subset      F24=More keys                     
                                                                                

  1. Type ‘Y’ in the Select record keywords , then Press enter
                                                   Select Subfile Control Keywords                        
                                                                                
 Subfile control record . . . . . . . . . :   SFLCTL                          
                                                                               
 Type choices, press Enter.                                                    
                                                                                
                                     Y=Yes                                     
   General keywords  . . . . . . . .                                           
   Subfile display layout  . . . . .                                           
   Subfile messages  . . . . . . . .                                           
                                                                               
   Select record keywords  . . . . .   Y                                       
                                                                               
   TEXT keyword  . . . . . . . . . .                                           
                                                                                
                                                                               
                                                                               
                                                                  
 F3=Exit   F4=Display Selected Keywords   F12=Cancel                           
                                                                               

  1.  Put ‘Y’ in the Indicator keywords field and Overlay keywords, Press enter

                                                             Select Record Keywords                             
                                                                               
 Record . . . :   SFLCTL                                                      
                                                                               
 Type choices, press Enter.                                                    
                                                                                
                                     Y=Yes                                     
   General keywords  . . . . . . . .                                           
   Indicator keywords  . . . . . . .   Y                                        
   Application help  . . . . . . . .                                           
   Help keywords . . . . . . . . . .                                           
   Output keywords . . . . . . . . .                                            
   Input keywords  . . . . . . . . .                                           
   Overlay keywords  . . . . . . . .   Y                                        
                                                                                
   Print keywords  . . . . . . . . .                                           
   ALTNAME keyword . . . . . . . . .                                           
                                                                               
   TEXT keyword  . . . . . . . . . .                                           
                                                                               
                                                                               
                                                                                
 F3=Exit   F4=Display Selected Keywords   F12=Cancel                           
                                                                               

  1. Defile the indicator here, Press enter
                                                  Define Indicator Keywords                           
                                                                               
 Record . . . :   SFLCTL                                                       
                                                                               
 Type keywords and parameters, press Enter.                                    
   Conditioned keywords:       CFnn CAnn CLEAR PAGEDOWN/ROLLUP PAGEUP/ROLLDOWN 
                               HOME HELP HLPRTN                                
   Unconditioned keywords:     INDTXT VLDCMDKEY SETOF CHANGE                   
                                                                               
 Keyword   Indicators/+ Resp Text                                              
 CF02                    02                                                    
 CF03                    03                                                                              
                                                                                
                                                                               
                                                                                      
                                                                               
                                                                         Bottom
 F3=Exit   F12=Cancel                                                          
                                                                               

  1. Put ‘Y’ in the Overlay without erasing field, Press enter two times
                                                         Select Overlay Keywords                            
                                                                               
 Record . . . :   SUBCTL1                                                      
                                                                                
 Type choices, press Enter.                                                    
                                          Keyword    Y=Yes  Indicators/+   Roll
   Overlay without erasing  . . . . . .   OVERLAY      Y                       
   Retain data on re-display  . . . . .   PUTRETAIN                            
   Protect all input fields . . . . . .   PROTECT                              
   Activate OVRDTA and OVRATR . . . . .   PUTOVR                               
   Override Data  . . . . . . . . . . .   OVRDTA                               
   Override Attribute . . . . . . . . .   OVRATR                               
   Initialize input fields  . . . . . .   INZINP                               
   Reset all modified data tags . . . .   MDTOFF                               
     MDTOFF parameter . . . . . . . . .     *UNPR                              
                                            *ALL                                
   Erase all input fields . . . . . . .   ERASEINP                             
     ERASEINP parameter . . . . . . . .     *MDTON                             
                                             *ALL                                
   Erase all records below  . . . . . .   ERASE                                
                                                                               
                                                                               
 F3=Exit   F12=Cancel                                                          
                                                                               

  1. Press F3 and save the display file and compile it

DDS Of The Display File:

Columns . . . :    1  71            Edit                        PB01U01D/MYDDS
 SEU==>                                                                  SUBFIL
 FMT A* .....A*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
        *************** Beginning of data *************************************
0000.10      A*%%TS  SD  20050325  130350  PB01U01     REL-V5R2M0  5722-WDS    
0000.20      A*%%EC                                                            
0000.30      A                                      DSPSIZ(24 80 *DS3)         
0000.40      A          R SFL                       SFL                        
0000.50      A*%%TS  SD  20050324  161747  PB01U01     REL-V5R2M0  5722-WDS    
0000.60      A            SEMPNO         3  0B  9 11                            
0000.70      A            SENAME        10   B  9 33                           
0000.80      A            SEGRAD         2   B  9 56                           
0000.90      A          R SFLCTL                    SFLCTL(SFL)                 
0001.00      A*%%TS  SD  20050325  110312  PB01U01     REL-V5R2M0  5722-WDS    
0001.10      A                                      CF02(02)                   
0001.20      A                                      CF03(03)                    
0001.30      A                                      OVERLAY                    
0001.40      A  80                                SFLDSP                     
0001.50      A  81                                SFLDSPCTL                  
0001.60      A  82                                SFLCLR                     
0001.70      A  83                                SFLEND(*MORE)              
0001.80      A                                      SFLSIZ(0010)               
0001.90      A                                      SFLPAG(0005)               
0002.00      A                                  2 33'LOAD ALL SUBFILE'         
0002.10      A                                      DSPATR(HI)                 
0002.20      A                                  1 71DATE                       
0002.30      A                                      EDTCDE(Y)                  
0002.40      A                                  2 71TIME                       
0002.50      A                                  1  2USER                       
0002.60      A                                  4  2'--------------------------
0002.70      A                                      ---------------------------
0002.80      A                                      --------'                   
0002.90      A                                      COLOR(BLU)                 
0003.00      A                                  8  2'--------------------------
0003.10      A                                      ---------------------------
0003.20      A                                      ---------'                 
0003.30      A                                      COLOR(BLU)                 
0003.40      A                                  6 11'EMP NO.'                  
0003.50      A                                      DSPATR(HI)                 
0003.60      A                                  6 33'EMP NAME'                 
0003.70      A                                      DSPATR(HI)                 
0003.80      A                                  6 56'EMP GRADE'                
0003.90      A                                      DSPATR(HI)                 
0004.00      A          R FOOTER                                               
0004.10      A*%%TS  SD  20050325  130350  PB01U01     REL-V5R2M0  5722-WDS    
0004.20      A                                 19  2'--------------------------
0004.30      A                                      ---------------------------
0004.40      A                                      ---------'                 
0004.50      A                                      COLOR(BLU)                 
0004.60      A                                 22  6'F2=UPDATE'                
0004.70      A                                 22 17'F3=EXIT'                  
        ****************** End of data ****************************************
                                                                               
                                                                                
                                                                                               
 F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F10=Cursor   F11=Toggle      
 F16=Repeat find       F17=Repeat change          F24=More keys                
                                                                               

Step3: RPG Program(For Multiple Display and Updation)

Columns . . . :    1  71            Edit                        PB01U01S/MYRPG
 SEU==>                                                                   LOAD1
 FMT *  ..... *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
        *************** Beginning of data *************************************
0000.01       *INDICATOR USED                                                  
0000.02       * F3= EXIT                                                        
0000.03       * F2= UPDATE                                                     
0000.04       * 80= SFLDSP                                                     
0000.05       * 81= SFLDSPCTL                                                  
0000.06       * 82= SFLCLR                                                     
0000.07       * 83= SFLEND                                                     
0000.08       * PHYSICAL FILE                                                  
0001.00      FEMP1    UF  E           K        DISK                            
0001.01       * DISPLAY FILE                                                   
0002.00      FSUBFIL  CF  E                    WORKSTN                         
0002.01       *IPFC PROMPT                                                      
0002.02       *SFL=SUB FILE RECORD FORMAT, RRN=RELATIVE RECORD NUMBER          
0003.00      F                                        RRN   KSFILE SFL         
0003.02       *CLEAR SUB ROUTINE IS CALLED HERE                                
0004.00      C                          EXSR CLEAR                                  
0004.01       *LOAD SUB ROUTINE IS CALLED HERE                                 
0005.00      C                           EXSR LOAD                                    
0005.01       **                                                               
0006.00      C           *IN03     DOWEQ*OFF                                   
0006.01       *FOOTER IS WRITE HERE                                             
0007.00      C                          WRITEFOOTER                                 
0008.00      C                          EXFMTSFLCTL                                 
0008.01      C           *IN02    IFEQ *ON                                    
0008.03      C                          EXSR UPDATE                                 
0008.04      C                          EXSR CLEAR                                  
0008.05      C                          EXSR LOAD                                   
0008.06      C                          SETOF                     02                
0008.07      C                          ENDIF                                       
0009.00      C                          ENDDO                                       
0009.01      C                          SETON                     LR                
0010.00       *****************************************************************
0011.00      C* CLEAR SUB ROUTINE                                              
0011.01       *****************************************************************
0012.00      C         CLEAR     BEGSR                                       
0013.00      C                          Z-ADD0         RRN     40                   
0014.00      C                          SETON                     82                
0015.00      C                         WRITESFLCTL                                 
0016.00      C                         SETOF                     82                
0017.00      C                         ENDSR                                        
0017.01       *****************************************************************
0018.00       *END OF CLEAR                                                    
0018.01       *****************************************************************
0018.01       *****************************************************************
0019.00       *                                                                
0019.01       *****************************************************************
0020.00       *LOAD SUB ROUTINE                                                
0020.01       *****************************************************************
0021.00      C           LOAD        BEGSR                                       
0022.00      C           *LOVAL    SETLLEMP1                                   
0022.01       **                                                               
0023.00      C           *IN03         DOWEQ*OFF                                   
0024.00      C                              READ EMP1                     90            
0024.01       **                                                               
0025.00      C           *IN90         IFEQ *ON                                    
0026.00      C                              LEAVE                                        
0027.00      C                              ENDIF                                       
0028.00       **                                                               
0029.00      C                              ADD  1         RRN                           
0029.01      C                              EXSR P2S                                    
0034.00      C                             WRITESFL                                    
0035.00      C                             ENDDO                                        
0035.01      C                            SETON                     81                
0036.00       **                                                               
0037.00      C              RRN       IFGT 0                                      
0038.00      C                             SETON                     80                
0039.00      C                             ELSE                                        
0040.00      C                             SETOF                     80                
0041.00      C                             ENDIF                                       
0042.00      C                             ENDSR                                       
0043.00       *****************************************************************
0044.00       * END OF LOAD SUB ROUTINE                                        
0045.00       *****************************************************************
0045.01       *                                                                
0045.02       *****************************************************************
0045.03       * UPDATE SUB ROUTINE                                             
0045.04       *****************************************************************
0045.05      C           UPDATE    BEGSR                                        
0045.06      C                              SETOF                     22                
0045.09      C           *IN22         DOWEQ*OFF                                   
0045.10      C                              READCSFL                      22             
0045.13      C           SEMPNO   CHAINEMP1                 20                
0045.14      C                               EXSR S2P                                    
0045.15      C                               UPDATEMP1R                                  
0045.17      C                               ENDDO                                       
0045.18      C                               ENDSR                                       
0045.19       *****************************************************************
0045.20       *END OF UPDATE SUB ROUTINE                                       
0045.21       *****************************************************************
0045.22       *****************************************************************
0045.23       * MOVING FIELDS FROM PHYSICAL FILE TO DISPLAY FILE (P2S)         
0045.24       **************************************************************** 
0045.25      C                   P2S       BEGSR                                       
0046.00      C                                 Z-ADDEMPNO    SEMPNO                       
0047.00      C                                 MOVE ENAME    SENAME                       
0048.00      C                                 MOVE EGRAD     SEGRAD                       
0049.00      C                                 ENDSR                                        
0050.00       *****************************************************************
0051.00       *END OF SUB ROUTINE (P2S)                                        
0052.00       *****************************************************************
0053.00       *                                                                
0054.00       *****************************************************************
0055.00       * MOVING FIELDS FROM DISPLAY FILE TO PHYSICAL FILE (S2P)         
0056.00       **************************************************************** 
0057.00      C           S2P       BEGSR                                       
0058.00      C                        Z-ADDSEMPNO    EMPNO                        
0059.00      C                        MOVE SENAME    ENAME                        
0059.00      C                        MOVE SENAME    ENAME                        
0060.00      C                        MOVE SEGRAD    EGRAD                        
0061.00      C                        ENDSR                                       
0062.00       *****************************************************************
0063.00       *END OF SUB ROUTINE (S2P)                                        
        ****************** End of data ****************************************

                                                                               
 F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F10=Cursor   F11=Toggle      
 F16=Repeat find       F17=Repeat change          F24=More keys                
                                                                                                                                                    

Display File:

  1. Subfile Control Format:

UUUUUUUUUU                                                                           DD/DD/DD 
                                          LOAD ALL SUBFILE                         TT:TT:TT 
                                                                               
 ----------------------------------------------------------------------------- 
                                                                               
        OPT          EMP NO.          EMP NAME           EMP GRADE               
                                                                                
 ------------------------------------------------------------------------------
      




                     
                                                                               
                                                                                
                                                                               
                                                                                                                         
                                                                               
                                                                               
                                                                                


  1. Subfile Record Format:

UUUUUUUUUU                                                                           DD/DD/DD 
                                              LOAD ALL SUBFILE                     TT:TT:TT 
                                                                                
 ----------------------------------------------------------------------------- 
                                                                               
      OPT          EMP NO.          EMP NAME           EMP GRADE                
                                                                               
 ------------------------------------------------------------------------------
        I                999-                BBBBBBBBBB           BB                      
        I                999-                BBBBBBBBBB           BB                      
        I                999-                BBBBBBBBBB           BB                      
        I                999-                BBBBBBBBBB           BB                      
        I                999-                BBBBBBBBBB           BB                      
                                                                               
                                                                               
                                                                                
                                                                               
                                                                                                                                  
                                                                               

  1. Footer:

                                                                                
                                                                               
                                                                               
                                                                                
                                                                               
                                                                               
                                                                               
                                                                                
                                                                               
                                                                                                                                                       
                                                                                
                                                                               
 ------------------------------------------------------------------------------
                                                                                
                                                                               
    F3=EXIT  F4=ADD  D=DELETE                                      
                                                                               
                                                                               

  1. Sec1:

  UUUUUUUUUU                                                         DD/DD/DD  
                                                                     TT:TT:TT  
                                    ADDITION                                   
 ------------------------------------------------------------------------------
                                                                               
                                                                                
                                                                               
        EMP NO...................:   333-                                      
                                                                                
        EMP NAME.................:   IIIIIIIIII                                
                                                                               
        EMP GRADE................:   II                                         
                                                                               
                                                                                                                                                     
                                                                               
                                                                               
 ------------------------------------------------------------------------------
    F2=SAVE  F3=EXIT                                                           
                                                                               

  1. DDS For Display File:
Columns . . . :    1  71            Edit                        PB01U01D/MYDDS
SEU==>                                                                  SUBFI1
 FMT A* .....A*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
        *************** Beginning of data *************************************
0000.10      A*%%TS  SD  20050402  133500  PB01U01     REL-V5R2M0  5722-WDS    
0000.20      A*%%EC                                                            
0000.30      A                                      DSPSIZ(24 80 *DS3)         
0000.40      A          R SFL                       SFL                        
0000.50      A*%%TS  SD  20050330  153651  PB01U01     REL-V5R2M0  5722-WDS    
0000.60      A  33                                  SFLNXTCHG                  
0000.70      A            SEMPNO         3S 0B  9 20                           
0000.80      A            SENAME        10A  B  9 37                           
0000.90      A            SEGRAD         2A  B  9 56                           
0001.00      A            OPT            1A  I  9  8                           
0001.10      A          R SFLCTL                    SFLCTL(SFL)                
0001.20      A*%%TS  SD  20050402  133500  PB01U01     REL-V5R2M0  5722-WDS    
0001.30      A                                      CF02(02)                   
0001.40      A                                      CF03(03)                   
0001.50      A                                      CF04(04)                    
0001.60      A                                      OVERLAY                    
0001.70      A  80                                  SFLDSP                     
0001.80      A  81                                  SFLDSPCTL                  
0001.90      A  82                                  SFLCLR                     
0002.00      A  83                                  SFLEND(*MORE)              
0002.10      A                                      SFLSIZ(0006)               
0002.20      A                                      SFLPAG(0005)               
0002.30      A                                  2 33'LOAD ALL SUBFILE'         
0002.40      A                                      DSPATR(HI)                 
0002.50      A                                  1 71DATE                       
0002.60      A                                      EDTCDE(Y)                  
0002.70      A                                  2 71TIME                       
0002.80      A                                  1  2USER                       
0002.90      A                                  4  2'--------------------------
0003.00      A                                      ---------------------------
0003.10      A                                      --------'                  
0003.20      A                                      COLOR(BLU)                 
0003.30      A                                  8  2'--------------------------
0003.40      A                                      ---------------------------
0003.50      A                                      ---------'                 
0003.60      A                                      COLOR(BLU)                 
0003.70      A                                  6 20'EMP NO.'                  
0003.80      A                                      DSPATR(HI)                 
0003.90      A                                  6 37'EMP NAME'                 
0004.00      A                                      DSPATR(HI)                 
0004.10      A                                  6 56'EMP GRADE'                
0004.20      A                                      DSPATR(HI)                 
0004.30      A                                  6  7'OPT'                      
0004.40      A                                      DSPATR(HI)                 
0004.50      A          R FOOTER                                               
0004.60      A*%%TS  SD  20050402  133500  PB01U01     REL-V5R2M0  5722-WDS    
0004.70      A                                 19  2'--------------------------
0004.80      A                                      ---------------------------
0004.90      A                                      ---------'                 
0005.00      A                                      COLOR(BLU)                 
0005.10      A                                 22  4'F3=EXIT'                  
0005.20      A                                 22 13'F4=ADD'                   
0005.30      A                                 22 21'D=DELETE'                  
0005.40      A          R SEC1                                                 
0005.50      A*%%TS  SD  20050402  133500  PB01U01     REL-V5R2M0  5722-WDS    
0005.60      A                                      CF02(02)                    
0005.70      A                                      CF03(03)                   
0005.80      A                                  1 70DATE                       
0005.90      A                                      EDTCDE(Y)                  
0006.00      A                                  2 70TIME                       
0006.10      A                                  1  3USER                       
0006.20      A                                  3 37'ADDITION'                 
0006.30      A                                      DSPATR(HI)                 
0006.40      A                                  4  2'--------------------------
0006.50      A                                      ---------------------------
0006.60      A                                      ---------'                 
0006.70      A                                      COLOR(BLU)                 
0006.80      A                                 22  2'--------------------------
0006.90      A                                      ---------------------------
0007.00      A                                      ---------'                 
0007.10      A                                      COLOR(BLU)                 
0007.20      A                                  8  9'EMP NO...................:
0007.30      A                                      DSPATR(HI)                 
0007.40      A                                 10  9'EMP NAME.................:
0007.50      A                                      DSPATR(HI)                  
0007.60      A                                 12  9'EMP GRADE................:
0007.70      A                                      DSPATR(HI)                 
0007.80      A            ID             3S 0I  8 38                           
0007.90      A            NAME          10A  I 10 38                           
0008.00      A            GRADE          2A  I 12 38                           
0008.10      A                                 23 14'F3=EXIT'                  
0008.20      A                                 23  5'F2=SAVE'                  
        ****************** End of data ****************************************
                                                                               
                                                                                
                                                                               
 F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F10=Cursor   F11=Toggle      
 F16=Repeat find       F17=Repeat change          F24=More keys                
                                                                                                                                                              

RPG Program (For Addition and  Deletion)

Columns . . . :    1  71            Edit                        PB01U01S/MYRPG
 SEU==>                                                                  LAAD1L
 FMT *  ..... *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 
        *************** Beginning of data *************************************
0000.01       *INDICATOR USED                                                  
0000.03       * F2= SAVE                                                       
0000.04       * F3= EXIT                                                        
0000.05       * F4= ADD                                                        
0000.06       * 80= SFLDSP                                                     
0000.07       * 81= SFLDSPCTL                                                   
0000.08       * 82= SFLCLR                                                     
0000.09       * 83= SFLEND                                                     
0000.10       * PHYSICAL FILE                                                   
0001.00      FEMP1    UF  E           K        DISK                      A     
0001.01       * DISPLAY FILE                                                   
0002.00      FSUBFI1  CF  E                    WORKSTN                         
0002.01       *IPFC PROMPT                                                     
0002.02       *SFL=SUB FILE RECORD FORMAT, RRN=RELATIVE RECORD NUMBER          
0003.00      F                                        RRN   KSFILE SFL         
0003.02       *CLEAR SUB ROUTINE IS CALLED HERE                                
0004.00      C                       EXSR CLEAR                                  
0004.01       *LOAD SUB ROUTINE IS CALLED HERE                                 
0005.00      C                       EXSR LOAD                                   
0005.01       **                                                               
0006.00      C           *IN03   DOWEQ*OFF                                   
0006.01       *FOOTER IS WRITE HERE                                             
0007.00      C                      WRITEFOOTER                                 
0008.00      C                      EXFMTSFLCTL                                 
0008.01      C   03               LEAVE                                        
0008.02       * IF OPT CONTAIN 'D'                                             
0008.03      C                          SETOF                         23            
0008.04      C           *IN23       DOWEQ*OFF                                    
0008.05      C                          READCSFL                      23            
0008.06      C           *IN23       IFEQ *OFF                                   
0008.07      C           OPT          IFEQ 'D'                                    
0008.08      C           SEMPNO    CHAINEMP1                 24                
0008.09      C                            DELETEMP1                                   
0008.10      C                           ENDIF                                       
0008.11      C                           ENDIF                                       
0008.12       *                                                                
0008.13      C             *IN23      IFEQ *ON                                    
0008.14      C                           EXSR CLEAR                                  
0008.15      C                           EXSR LOAD                                   
0008.16      C                           ENDIF                                       
0008.17      C                           ENDDO                                       
0008.18       * IF F4 IS PRESSED                                               
0008.19      C             *IN04     IFEQ *ON                                    
0008.20      C                          SETOF                     04                
0008.21      C                          EXSR ADDR                                   
0008.22      C                          EXSR CLEAR                                  
0008.23      C                          EXSR LOAD                                    
0008.24      C                          ENDIF                                       
0008.25       *                                                                
0009.00      C                          ENDDO                                        
0009.01      C                          SETON                     LR                
0010.00       *****************************************************************
0011.00      C* CLEAR SUB ROUTINE                                              
0011.01       *****************************************************************
0012.00      C           CLEAR     BEGSR                                       
0013.00      C                         Z-ADD0         RRN     40                   
0014.00      C                         SETON                     82                
0015.00      C                         WRITESFLCTL                                 
0016.00      C                         SETOF                     82                
0017.00      C                         ENDSR                                       
0017.01       *****************************************************************
0018.00       *END OF CLEAR                                                    
0018.01       *****************************************************************
0019.00       *                                                                
0019.01       *****************************************************************
0020.00       *LOAD SUB ROUTINE                                                 
0020.01       *****************************************************************
0021.00      C              LOAD        BEGSR                                       
0022.00      C             *LOVAL     SETLLEMP1                                    
0022.01       **                                                               
0023.00      C             *IN03        DOWEQ*OFF                                   
0024.00      C                             READ EMP1                     90            
0024.01       **                                                               
0025.00      C             *IN90       IFEQ *ON                                    
0026.00      C                            LEAVE                                       
0027.00      C                            ENDIF                                       
0028.00       **                                                               
0029.00      C                            ADD  1         RRN                          
0029.01      C                            EXSR P2S                                    
0034.00      C                            WRITESFL                                    
0035.00      C                            ENDDO                                       
0035.01      C                            SETON                     81                
0036.00       **                                                               
0037.00      C               RRN       IFGT 0                                      
0038.00      C                            SETON                     80                
0039.00      C                            ELSE                                        
0040.00      C                            SETOF                     80                
0041.00      C                            ENDIF                                        
0042.00      C                            ENDSR                                       
0043.00       *****************************************************************
0044.00       * END OF LOAD SUB ROUTINE                                        
0045.00       *****************************************************************
0045.01       *                                                                
0045.22       *****************************************************************
0045.23       * MOVING FIELDS FROM PHYSICAL FILE TO DISPLAY FILE (P2S)         
0045.24       **************************************************************** 
0045.25      C              P2S       BEGSR                                       
0046.00      C                          Z-ADDEMPNO     SEMPNO                       
0047.00      C                           MOVE ENAME     SENAME                       
0048.00      C                           MOVE EGRAD     SEGRAD                       
0049.00      C                           ENDSR                                        
0050.00       *****************************************************************
0051.00       *END OF SUB ROUTINE (P2S)                                        
0052.00       *****************************************************************
0053.00       *                                                                
0054.00       *****************************************************************
0055.00       * MOVING FIELDS FROM DISPLAY FILE TO PHYSICAL FILE (S2P)         
0056.00       **************************************************************** 
0057.00      C            S2P       BEGSR                                       
0058.00      C                        Z-ADDSEMPNO    EMPNO                        
0059.00      C                        MOVE SENAME    ENAME                        
0060.00      C                        MOVE SEGRAD    EGRAD                        
0061.00      C                        ENDSR                                       
0062.00       *****************************************************************
0063.00       *END OF SUB ROUTINE (S2P)                                        
0064.00       *****************************************************************
0065.00       *ADD SUB ROUTINE (ADDR)                                          
0066.00       *****************************************************************
0067.00      C           ADDR      BEGSR                                       
0068.00      C           *IN03     DOWEQ*OFF                                   
0069.00      C                         EXFMTSEC1                                   
0070.00      C           *IN03     IFEQ *ON                                    
0071.00      C                         SETOF                     03                
0072.00      C                         LEAVE                                       
0073.00      C                         ENDIF                                       
0074.00      C           *IN02     IFEQ *ON                                     
0075.00      C                        SETOF                     02                
0076.00      C                        Z-ADDID        EMPNO                        
0077.00      C                        MOVELNAME      ENAME                         
0078.00      C                        MOVELGRADE     EGRAD                        
0079.00      C                        WRITEEMP1R                                  
0080.00      C                        ENDIF                                       
0081.00      C                        ENDDO                                       
0082.00      C                        ENDSR                                       
0083.00       *****************************************************************
0084.00       *END OF SUB ROUTINE (ADDR)                                       
0085.00       *****************************************************************
        ****************** End of data ****************************************
                                                                                
                                                                               
                                                                               
                                                                                
                                                                               
 F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F10=Cursor   F11=Toggle      
 F16=Repeat find       F17=Repeat change          F24=More keys                
                                                                               

No comments:

Post a Comment