Is it possible to create a task that will execute a mapless dialog on a set frequency?

Document ID : KB000048682
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

You could define an autotask to execute an assembler program that executes two #SETIME. The first #SETIME re-executes the assembler program itself after a specified time interval and the second #SETIME executes the mapless dialog. After that specified interval the assembler program triggers itself and the mapless dialog.

Solution:

This is an example of how to accomplish this task:

        PRINT ON                                                              
        SPACE 2                                                               
        COPY  #CSADS                                                          
        EJECT                                                                 
        PRINT ON                                                              
        PRINT GEN                                                             
        #MOPT CSECT=POST2,ENV=USER                                            
        @MODE MODE=IDMSDC                                                    
        @INVOKE PROGRAM=POSTPGM                                             
        ENTRY POSTEP                                                        
POSTEP   CSECT                                                                
        USING POSTEP,R12                                                    
        USING SYSLST,R2                                                      
        LR    R12,R15                                                        
        USING CSA,R10            ESTABLISH CSA ADDRESSABILITY                
        #GETSTG TYPE=(USER,LONG,KEEP),PLIST=*,LEN=WORKALEN,           X      
              INIT=X'00',STGID='POS2',ADDR=(R2),RGSV=(R2,R8)                 
        #SETIME TYPE=STRTASK,PLIST=SYSPLIST,INTVL=3600,               X      
              TSKCD='POSTPGM'                                               
        #SETIME TYPE=STRTASK,PLIST=SYSPLIST,INTVL=3600,               X      
              TSKCD='TDLG'                                                   
        #FREESTG STGID='POS2'                                                
        #RETURN                                                              
        LTORG                                                                
SYSLST   DSECT                                                                
SYNECBID                         DS    CL4'SYN2'                              
SYNECB                           DS    3F                                     
SYSPLIST                         DS    20F                                    
WORKALEN EQU   ((*-SYSLST+3)/4)*4                                             
        END                                                                  

Modify parm INTVL=3600 on the #SETIME to control the frequency. INTVL is in seconds.

Assembler and link JCL:

//IDMSDMLA EXEC PGM=IDMSDMLA,REGION=4000K                                     
//STEPLIB  DD DSN=....                                                        
//CDMSLIB  DD DSN=.....                                                       
//SYSLST   DD SYSOUT=*                                                        
//SYS001   DD DSN=&&WRK1,DISP=(NEW,DELETE),UNIT=SYSDA,                        
//         DCB=(RECFM=VB,LRECL=133,BLKSIZE=1334,DSORG=PS),                    
//         SPACE=(TRK,(10,10))  
//SYS002   DD DSN=&&WRK2,DISP=(NEW,DELETE),UNIT=SYSDA,                  
//         DCB=(RECFM=VB,LRECL=133,BLKSIZE=1334,DSORG=PS),              
//         SPACE=(TRK,(10,10))                                          
//SYS003   DD DSN=&&WRK3,DISP=(NEW,DELETE),UNIT=SYSDA,                  
//         DCB=(RECFM=VB,LRECL=133,BLKSIZE=1334,DSORG=PS),              
//         SPACE=(TRK,(10,10))                                          
//SYSJRNL  DD DUMMY                                                     
//SYSIDMS  DD *                                                         
DICTNAME=yourdict                                                       
DBNAME=yourdb                                                        
DMCL=yourdmcl                                                         
/*                                                                      
//SYSIPT   DD DSN=SOURCE.POSTPGM                                       
//SYSPCH   DD DSN=&&DMLA,UNIT=SYSDA,DISP=(NEW,PASS),                    
//         SPACE=(TRK,(5,5)),                                           
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120)                         
//ASMSTEP EXEC PGM=ASMA90,REGION=0M                                     
//SYSLIB    DD DSN=your.DISTMAC,DISP=SHR                   
//          DD DSN=SYS1.MACLIB,DISP=SHR                                 
//SYSUT1    DD DSN=&&SYSUT1,UNIT=SYSDA,SPACE=(CYL,(15,10))              
//SYSUT2    DD DSN=&&SYSUT2,UNIT=SYSDA,SPACE=(CYL,(15,10))              
//SYSUT3    DD DSN=&&SYSUT3,UNIT=SYSDA,SPACE=(CYL,(15,10))              
//SYSPRINT  DD SYSOUT=*                                                 
//SYSLIN    DD DSN=&&OBJECT,DISP=(NEW,PASS),UNIT=SYSDA,                 
//             SPACE=(CYL,(15,10))                                      
//SYSIN    DD  DSN=&&DMLA,DISP=(OLD,DELETE)                             
//LINK     EXEC PGM=IEWL,PARM='RENT,LET,LIST,XREF',REGION=512K          
//SYSLIB   DD DSN=your.LOADLIB,DISP=SHR               
//SYSLIN   DD DSN=&&OBJECT,DISP=(OLD,DELETE)                             
//         DD DDNAME=SYSIN                                               
//SYSIN    DD *                                                          
 INCLUDE SYSLIB(IDMS)                                                   
 INCLUDE SYSLIB(IDMSBALI)                                               
 MODE  AMODE(31),RMODE(ANY)                                             
 ENTRY POSTEP                                                           
 NAME  POSTPGM(R)                                                      
/*                                                                       
//SYSLMOD  DD DSN=your.USER.LOADLIB,DISP=SHR                
//SYSPRINT DD SYSOUT=*                                                   
//SYSUT1   DD DSN=&&SYSUT1,UNIT=SYSDA,SPACE=(6400,(80)),                 
//            DISP=(NEW,DELETE)                                          
//SYSUT2   DD DSN=&&SYSUT1,UNIT=SYSDA,SPACE=(6400,(80)),                 
//            DISP=(NEW,DELETE)                                          
//SYSUT3   DD DSN=&&SYSUT1,UNIT=SYSDA,SPACE=(6400,(80)),                 
//            DISP=(NEW,DELETE)

Add the following definitions to the sysgen.

    ADD PROGRAM POSTPGM                            
        CONCURRENT                                  
        DYNAMIC                                     
        DUMP THRESHOLD IS 0                         
        ENABLED                                     
        ERROR THRESHOLD IS 5                        
        ISA SIZE IS 0                               
        LANGUAGE IS ASSEMBLER                       
        NOMAINLINE                                  
        MULTIPLE ENCLAVE IS ON                      
        NEW COPY IS ENABLED                         
        OVERLAYABLE                                 
        PROGRAM                                     
        PROTECT                                     
        REENTRANT                                   
        NONRESIDENT                                 
        REUSABLE                                    
        SAVEAREA                                    
        .      
                                        
    ADD TASK POSTPGM                                                        
        ENABLED                                                          
        EXTERNAL                                                         
        EXTERNAL WAIT IS SYSTEM                                          
        INACTIVE INTERVAL IS SYSTEM                                      
        INVOKES PROGRAM POSTPGM                                         
        NOINPUT                                                          
        NOMAP                                                            
        ON COMMIT SYSTEM                                                 
        ON ROLLBACK CONTINUE SYSTEM                                      
        PRINT KEY IS SYSTEM                                              
        PRIORITY IS 100                                                  
        RESOURCE TIMEOUT INTERVAL IS SYSTEM PROGRAM IS SYSTEM            
        SAVE                                                             
        LOCATION IS ANY                                                  
        STORAGE LIMIT IS SYSTEM                                          
        LOCK LIMIT IS SYSTEM                                             
        CALL LIMIT IS SYSTEM                                             
        DBIO LIMIT IS SYSTEM                                             
        MAXIMUM CONCURRENT THREADS IS OFF                                
        AREA ACQUISITION THRESHOLD IS DEFAULT                            
        PROTOCOL IS DEFRESP                                              
        QUIESCE WAIT IS SYSTEM                                           
        TRANSACTION SHARING IS SYSTEM                                    
        .    
 
 
    ADD TASK                                                       
        ENABLED                                                          
        EXTERNAL                                                         
        EXTERNAL WAIT IS SYSTEM                                          
        INACTIVE INTERVAL IS SYSTEM                                      
        INVOKES PROGRAM ADSORUN1                                         
        NOINPUT                                                          
        NOMAP                                                            
        ON COMMIT SYSTEM                                                 
        ON ROLLBACK CONTINUE SYSTEM                                      
        PRINT KEY IS SYSTEM                                              
        PRIORITY IS 100                                                  
        RESOURCE TIMEOUT INTERVAL IS SYSTEM PROGRAM IS SYSTEM            
        SAVE                                                             
        LOCATION IS ANY                                                  
        STORAGE LIMIT IS SYSTEM                                          
        LOCK LIMIT IS SYSTEM                                             
        CALL LIMIT IS SYSTEM                                             
        DBIO LIMIT IS SYSTEM                                             
        MAXIMUM CONCURRENT THREADS IS OFF                                
        AREA ACQUISITION THRESHOLD IS DEFAULT                            
        PROTOCOL IS DEFRESP                                              
        QUIESCE WAIT IS SYSTEM                                           
        TRANSACTION SHARING IS SYSTEM                                    
        .  
 
   ADD AUTOTASK POSTPGM                
       INVOKED AT STARTUP           
        .