• 大机中的asm example


    QMF ne fournit pas la requête Q1 ou le format F1, mais l’exemple de programme utilise ces objets.

    
    ```cobol
    DSQABFA  TITLE 'SAMPLE QMF CALLABLE INTERFACE'                         
    DSQABFA  CSECT                                                         
    DSQABFA  AMODE 31                                                      
    DSQABFA  RMODE ANY                                                     
    ***********************************************************************
    *                                                                     *
    *  Sample Program:  DSQABFA                                           *
    *  Assembler Version of the QMF Callable Interface                    *
    *                                                                     *
    ***********************************************************************
             SPACE 1                                                       
             STM   R14,R12,12(R13)       SAVE ENTRY REGISTERS              
             BALR  R12,0                 INITIALIZE BASE REGISTER          
             USING *,R12                                                   
             LA    R2,SAVEAREA           CHAIN SAVE AREAS                  
             ST    R2,8(R13)                                               
             ST    R13,SAVEAREA+4                                          
             LR    R13,R2                ESTABLISH SAVE AREA               
             SPACE 1                                                       
    ***********************************************************************
    * Start a query interface session                                     *
    ***********************************************************************
             LA    R4,CICOMM             ESTABLISH ACCESS TO DSQCOMM       
             USING DSQCOMM,R4                                              
             SPACE 1                                                       
             MVC   DSQ_COMM_LEVEL,DSQ_CURRENT_COMM_LEVEL                   
             LA    R1,1                  1 PARAMETER                       
             ST    R1,NUMPARMS                                             
             CALL  DSQCIA,                                                 
                   (CICOMM,              QI COMMON AREA                    
                   STARTQIL,             START COMMAND LENGTH              
                   STARTQI,              START COMMAND                     
                   NUMPARMS,             NUMBER OF KEYWORDS                
                   STARTKYL,             KEYWORD LENGTHS                   
                   STARTKY,              KEYWORDS                          
                   STARTVL,              VALUE LENGTHS                     
                   STARTV,               VALUES                            
                   DSQ_VARIABLE_CHAR),VL VALUES ARE CHARACTERS             
             SPACE 1                                                       
    ***********************************************************************
    * Set numeric values into query using SET command                     *
    ***********************************************************************
             SPACE 1                                                       
             LA    R1,20                 SET VALUES TO BE MODIFIED         
             ST    R1,VVAL1                                                
             LA    R1,40                                                   
             ST    R1,VVAL2                                                
             LA    R1,84                                                   
             ST    R1,VVAL3                                                
             LA    R1,3                  3 PARAMETERS                      
             ST    R1,NUMPARMS                                             
             SPACE 1                                                       
             CALL  DSQCIA,                                                 
                   (CICOMM,                                                
                   SETGL,                SET GLOBAL COMMAND LENGTH         
                   SETG,                 SET GLOBAL COMMAND                
                   NUMPARMS,             NUM OF VARIABLES TO BE SET        
                   VNAME1L,              VARIABLE NAME LENGTHS             
                   VNAME1,               VARIABLE NAMES                    
                   VVAL1L,               VALUE LENGTHS                     
                   VVAL1,                VALUES                            
                   DSQ_VARIABLE_FINT),VL VALUES ARE INTEGERS               
             SPACE 1                                                       
    ***********************************************************************
    * Run a query                                                         *
    ***********************************************************************
             SPACE 1                                                       
             CALL  DSQCIA,                                                 
                   (CICOMM,                                                
                   QUERYL,               QUERY COMMAND LENGTH              
                   QUERY),VL             TEXT OF QUERY COMMAND             
             SPACE 1                                                       
    ***********************************************************************
    * Print the result of the query                                       *
    ***********************************************************************
             SPACE 1                                                       
             CALL  DSQCIA,(CICOMM,REPTL,REPT),VL    
             SPACE 1                                                       
    ***********************************************************************
    * End the query interface session                                     *
    ***********************************************************************
             SPACE 1                                                       
             CALL  DSQCIA,(CICOMM,ENDQIL,ENDQI),VL                         
             SPACE 1                                                       
    ***********************************************************************
    * Return                                                              *
    ***********************************************************************
             SPACE 1                                                       
             SR    R15,R15               SET RETURN CODE                   
             L     R13,4(R13)                                              
             L     R14,12(R13)           RESTORE CALLER REGISTERS          
             LM    R0,R12,20(R13)                                          
             BR    R14                                                     
             EJECT                                                         
    ***********************************************************************
    * Data Areas                                                          *                   
    ***********************************************************************
             SPACE 1                                                       
    *  Query Interface commands                                            
             SPACE 1                                                       
    STARTQI  DC    C'START'              START FUNCTION                    
    SETG     DC    C'SET GLOBAL'         SET GLOBAL FUNCTION               
    QUERY    DC    C'RUN QUERY Q1'       RUN QUERY                         
    REPT     DC    C'PRINT REPORT (FORM=F1)'  PRINT REPORT                 
    ENDQI    DC    C'EXIT'               END INTERFACE                     
             SPACE 1                                                       
             DS    0F                                                      
    STARTQIL DC    AL4(L'STARTQI)        LENGTH OF START FUNCTION          
    SETGL    DC    AL4(L'SETG)           LENGTH OF SET GLOBAL FUNCTION     
    QUERYL   DC    AL4(L'QUERY)          LENGTH OF RUN QUERY COMMAND       
    REPTL    DC    AL4(L'REPT)           LENGTH OF PRINT REPORT COMMAND    
    ENDQIL   DC    AL4(L'ENDQI)          LENGTH OF END INTERFACE COMMAND   
             SPACE 1                                                       
    *  START command keyword                                               
             SPACE 1                                                       
    STARTKY  DC    C'DSQSMODE'          
    STARTV   DC    C'INTERACTIVE'       
             DS    0F                   
    STARTKYL DC    AL4(L'STARTKY)       
    STARTVL  DC    AL4(L'STARTV)        
             SPACE 1                    
    *  SET GLOBAL command variable names
             SPACE 1                    
    VNAME1   DC    C'MYVAR01'           
    VNAME2   DC    C'SHORT'             
    VNAME3   DC    C'MYVAR03'           
             DS    0F                   
    VNAME1L  DC    AL4(L'VNAME1)        
    VNAME2L  DC    AL4(L'VNAME2)        
    VNAME3L  DC    AL4(L'VNAME3)        
             SPACE 1                    
    *  SET GLOBAL command values        
             SPACE 1                    
    VVAL1    DS    F                    
    VVAL2    DS    F                                               
    VVAL3    DS    F                                               
    VVAL1L   DC    AL4(L'VVAL1)                                    
    VVAL2L   DC    AL4(L'VVAL2)                                    
    VVAL3L   DC    AL4(L'VVAL3)                                    
             SPACE 1                                               
    NUMPARMS DS    F                     NUMBER OF KEYWORDS        
             SPACE 1                                               
    *  Callable interface communications area                      
             SPACE 1                                               
    CICOMM   DS    CL(DSQCOMM_LEN)                                 
             SPACE 1                                               
    SAVEAREA DS    18F                                             
             EJECT                                                 
             DSQCOMMA                                              
             SPACE 1                                               
    R0       EQU   00                    EQUATES FOR REGISTERS 0-15
    R1       EQU   01                                              
    R2       EQU   02                                              
    R3       EQU   03     
    R4       EQU   04     
    R5       EQU   05     
    R6       EQU   06     
    R7       EQU   07     
    R8       EQU   08     
    R9       EQU   09     
    R10      EQU   10     
    R11      EQU   11     
    R12      EQU   12     
    R13      EQU   13     
    R14      EQU   14     
    R15      EQU   15     
             SPACE 1      
             END   DSQABFA
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    
    
    
    
    
    • 1
    • 2
    • 3
    • 4
  • 相关阅读:
    【AGC】应用安装报错没有证书怎么办
    Spring Boot 国际化 i18n
    Excel-VBA 快速上手(十一、字符串常用操作)
    Salesforce中国区解散,谁是替代的最佳选择?
    Java零基础入门------------笔记一(基础概念1.0)
    LVGL_基础控件btnmatrix
    JavaScript之window对象最常用相关知识总结
    net-java-php-python-网络安全教育学习网站计算机毕业设计程序
    PI/PO Token配置
    使用云服务器作为跳板机器远程转发内网机器端口的jupyter服务
  • 原文地址:https://blog.csdn.net/CNMBZY/article/details/136858707