⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fxidck.cbl

📁 用COBOL写的身份证查询代码,数据库未提供.
💻 CBL
📖 第 1 页 / 共 2 页
字号:
                              if check-num6 < 1
                                or check-num6 > 28
                                  move 8 to pass-rtn-req
                                  go to check-dte-sex-e
                              end-if
                       end-if
                    end-if 
                    move check-num7 to check-num5
                    move 100 to mod-num
                    perform mod-id
                    if check-num5 not = 0
                       move check-num7 to check-num5
                       move 4 to mod-num
                       perform mod-id
                       if check-num5 = 0
                          if check-num6 < 1
                            or check-num6 > 29
                              move 8 to pass-rtn-req
                              go to check-dte-sex-e
                          end-if
                          else
                              if check-num6 < 1
                                or check-num6 > 28
                                  move 8 to pass-rtn-req
                                  go to check-dte-sex-e
                              end-if
                       end-if
                    end-if
               when 3
                    if check-num6 < 1
                      or check-num6 > 31
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
               when 4   
                    if check-num6 < 1
                      or check-num6 > 30
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
               when 5
                    if check-num6 < 1
                      or check-num6 > 31
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if 
               when 6
                    if check-num6 < 1
                      or check-num6 > 30
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
               when 7
                    if check-num6 < 1
                      or check-num6 > 31
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
               when 8
                    if check-num6 < 1
                      or check-num6 > 31
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
               when 9
                    if check-num6 < 1
                      or check-num6 > 30
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
               when 10
                    if check-num6 < 1
                      or check-num6 > 31
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
               when 11
                    if check-num6 < 1
                      or check-num6 > 30
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
               when 12
                    if check-num6 < 1
                      or check-num6 > 31
                        move 8 to pass-rtn-req
                        go to check-dte-sex-e
                    end-if
           end-evaluate.
           if check-sys-dte1-mm = check-num1
              if check-sys-dte1-dd < check-num6
                 move 9 to pass-rtn-req
                 go to check-dte-sex-e
              end-if
           end-if.      
           
           move spaces to check-num2.
           move pass-id1 (17:1) to check-num2.
           move check-num2 to check15-num4.
           move 2 to mod-num.
           divide check15-num4 by mod-num giving mod-id-num
               remainder sex-num.   
       check-dte-sex-e.
           exit.
                                                                                                                      
       check-length.
           if pass-id1 = spaces
               move 1 to pass-rtn-req
               go to check-length-e
           end-if.    
           move 1 to check-num1.
       
       check-length-loop.              
           move spaces to check-num2.
           move pass-id1 (check-num1:1) to check-num2.
           if check-num2 = spaces
               move 2 to pass-rtn-req
               go to check-length-e
           end-if.
           if check-num2 not = "0"
           and check-num2 not = "1" 
           and check-num2 not = "2"
           and check-num2 not = "3"
           and check-num2 not = "4"
           and check-num2 not = "5"
           and check-num2 not = "6"
           and check-num2 not = "7"
           and check-num2 not = "8"
           and check-num2 not = "9"
               move 6 to pass-rtn-req
               go to check-length-e
           else      
               add 1 to check-num1
               if check-num1 = 16
                   go to check-length16-18
               else
                   go to check-length-loop
               end-if
           end-if.             
       check-length16-18.
           move spaces to check-num3.
           move pass-id1 (check-num1:3) to check-num3.
           if check-num3 = spaces
               perform tran15-18 thru tran15-18-e
               go to check-length-e
               else
                   go to check-length16-18-loop
           end-if.        
       check-length16-18-loop.
           move spaces to check-num2.
           move pass-id1 (check-num1:1) to check-num2.
           if check-num2 = spaces
               move 2 to pass-rtn-req
               go to check-length-e
           end-if.
           if check-num2 not = "0"
           and check-num2 not = "1" 
           and check-num2 not = "2"
           and check-num2 not = "3"
           and check-num2 not = "4"
           and check-num2 not = "5"
           and check-num2 not = "6"
           and check-num2 not = "7"
           and check-num2 not = "8"
           and check-num2 not = "9"
               move 6 to pass-rtn-req
               go to check-length-e
           else    
               add 1 to check-num1
               if check-num1 = 18
                   go to check-length18
               else
                   go to check-length16-18-loop
               end-if
           end-if.
       check-length18.
           move spaces to check-num2.
           move pass-id1 (check-num1:1) to check-num2.
           if check-num2 = spaces
               move 2 to pass-rtn-req
               go to check-length-e.
           if check-num2 not = "0"
           and check-num2 not = "1" 
           and check-num2 not = "2"
           and check-num2 not = "3"
           and check-num2 not = "4"
           and check-num2 not = "5"
           and check-num2 not = "6"
           and check-num2 not = "7"
           and check-num2 not = "8"
           and check-num2 not = "9"
           and check-num2 not = "x"
               move 6 to pass-rtn-req
               go to check-length-e
           else
               go to check-length-e.
       check-length-e.
           exit.                                                                  
                
       tran15-18.
           move spaces to check15-num3.
           move spaces to check15-num1.
           move spaces to check15-num2.
           move pass-id1 (1:6) to check15-num1.
           move pass-id1 (7:9) to check15-num2.
           string check15-num1 "19" check15-num2
               into check15-num3. 
           move pass-id1 to pass-id15.      
           move 18 to place-num. 
           move 1 to check-num1. 
       tran15-18-loop.      
           move 0 to check15-num4.
           move spaces to check-num2.
           move 0 to check-num6.
           move check15-num3(check-num1:1) to check-num2.
           move check-num2 to check15-num4.
           compute check-num5 = 2 ** (place-num - 1).  
           move 11 to mod-num.
           perform mod-id.
           multiply check15-num4 by check-num5 giving check-num6.
           add check-num6 to check-sum.
           add 1 to check-num1.
           subtract 1 from place-num.
           if place-num = 1
              move check-sum to check-num5
              move 11 to mod-num
              perform mod-id
              perform tran-mod-checknum
              perform tran15-to-18
              else
                  go to tran15-18-loop
           end-if. 
       tran15-to-18.
           move 0 to check-sum.
           move spaces to pass-id1.
           string check15-num3 checknum
               into pass-id1.
*           move 1 to put-id15-num.
       tran15-18-e.
           exit.                  
       
       tran-mod-checknum.
           if check-num5 = 0
              move "1" to checknum.
           if check-num5 = 1
              move 0 to checknum.
           if check-num5 = 2
              move "x" to checknum. 
           if check-num5 = 3
              move "9" to checknum.
           if check-num5 = 4
              move "8" to checknum.
           if check-num5 = 5
              move "7" to checknum.
           if check-num5 = 6
              move "6" to checknum.
           if check-num5 = 7
              move "5" to checknum.
           if check-num5 = 8
              move "4" to checknum.
           if check-num5 = 9
              move "3" to checknum. 
           if check-num5 = 10
              move "2" to checknum.
              
       mod-id.
           divide check-num5 by mod-num giving mod-id-num
               remainder check-num5.                                                                                                    

       pgm-end.
           exit program.


       copy lib60sda.r.
       copy lib60man.r.
       copy lib60str.r.
       copy lib60num.r.
       copy lib60y20.r.
       
       copy idcs.rou.
       copy supe.rou.
       
       

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -