- 浏览: 203915 次
文章分类
- 全部博客 (224)
- jsp (5)
- jsf (7)
- web (11)
- js (12)
- COBOL (5)
- php (7)
- jconsole (1)
- java (11)
- ajax (1)
- PHP魔法方法 (1)
- 项目管理工具 (3)
- 项目管理 (2)
- svn (8)
- redmine (1)
- mysql (4)
- qrcode,php (1)
- qrcode (1)
- 多进程 (3)
- html (1)
- excel (2)
- seasar2 (1)
- db (1)
- entity (1)
- IOS8 (1)
- SWIFT (1)
- 正则表达式 (1)
- RabbitVCS (1)
- url (1)
- thinkphp (2)
- c++ (5)
- win32 API函数 (1)
- htaccess (1)
- makefile (3)
- C/C++ (12)
- Linux (1)
- miui (2)
- unix (1)
- wechat (1)
- websocket (1)
- SpringMVC (3)
- VSAM (1)
- centos (2)
- wamp (1)
- server (1)
- 优酷视频上传并去除广告 (1)
- owncload (1)
- cloud (1)
- ubuntu (1)
- pdf转换成word (1)
- 微信,weixin (1)
- 行业系统 (3)
- 超级外卖源代码 (0)
- 软件专利 (1)
- 申请 (1)
- vba (1)
- UML (1)
- 程序切片 (1)
- 股票心得 (1)
- 威客建站 (1)
- 微信开发学习路线 (1)
- 远程开机 (1)
- spring mvc (1)
- JEECMS (1)
- Node.js (1)
- ThinkJS (1)
- maven (2)
- MyEclipse+Tomcat+MAVEN+SVN (1)
- Spring+SpringMVC+MyBatis (1)
- wampserver (0)
- RESTful (1)
- hibernate (4)
- Spring+SpringMVC (1)
- 响应式布局 (1)
- 响应式布局模板 (1)
- Aptana (3)
- 遗传算法 (1)
- 进化算法 (1)
- bower (1)
- HTML5 (1)
- Android官方培训课程 (1)
- MySQL锁 (1)
- 扫描枪 (1)
- 微信公众平台 (1)
- 企业号 (1)
- ddns (1)
- java获取外网ip (1)
- DDNS,阿里云,云解析,万网域名,阿里云域名 (1)
- SEO (1)
- Jboss (2)
- wildfly (1)
- WildFly8 (2)
- NT Kernel (1)
- 反向代理 (1)
- Spring嵌套事务 (1)
- apache (3)
- 防止浏览器记住用户名及密码的简单实用方法 (1)
- 时间戳 (1)
- 字体 (1)
- 网络爬虫准 (1)
- 屏蔽后退按钮 (1)
- java web (1)
- JavaMail (1)
- windows服务 (1)
- Freemarker (1)
- TortoiseGit (2)
- oschina (1)
- JSON (1)
- Boost (1)
- MUI (1)
- github (1)
- Python2.7 (1)
- Python3.0 (1)
- Odoo (1)
- java socket (1)
- OpenERP (2)
- werkzeug (1)
- JNA (2)
- proxifier (1)
- WebService (1)
- 企业应用集成 (1)
- vmware (1)
- Navicate (1)
- 三体 (1)
- oracle同步 (1)
- 微信 (3)
- java设计模式 (1)
- 工具 (1)
- JavaScript跨域 (1)
- LB (1)
- 负载均衡 (1)
- AngularJS (1)
- HBuilder (1)
- Echarts (1)
- Json Web Token (1)
- PassportSDK (1)
- ubuntu kylin xterm 乱码 (1)
- ubuntu kylin17 安装字体教程 (1)
- wps (1)
- jetbrains (1)
- MySQL5.7 (1)
- Nginx (1)
- JDK (1)
最新评论
-
cuiyadll:
谢谢楼上的推荐
实战:jQuery Mobile开发HTML5移动应用 -
marty:
使用JQueryMobile,推薦使用這免費開發工具,提供可視 ...
实战:jQuery Mobile开发HTML5移动应用 -
men_clslji:
按照目前的方法只是防止刷新页面时不再执行X(添加),而toke ...
有了上一篇博文,类似地顺便说说表单防重复提交。
1、COMPUTE A = + B,A = - B 一般为笔误,执行结果:A的值等于|B|。
测试:
MOVE 5 TO WK-INPUT
MOVE 5 TO WK-OUTPUT
或者
MOVE -5 TO WK-INPUT
MOVE -5 TO WK-OUTPUT
COMPUTE WK-OUTPUT = + WK-INPUT
执行结果:WK-OUTPUT结果为5.
COMPUTE WK-OUTPUT = - WK-INPUT
执行结果:WK-OUTPUT结果为5.
2、THRU笔误:编译测试均通过
以下包括THRU执行流程、THRU笔误执行测试。
如下笔误:
…… ==> 该部分代码正常执行
PERFORM XXXX-TEST-PREFORM
THRU XXXX-TEST-PREFORM EXIT ==> 红色字为COBOL关键字 不执行XXXX-TEST-PROFORM-EXIT
…… ==> 该部分代码正常执行
XXXX-TEST-PROFORM-EXIT.
EXIT.
上述语句编译成功,不影响正常程序流,程序执行步骤完全一致,所有测试全部通过。
EXIT语句,其实就是标识而已,不起作用。
若XXXX-TEST-PROFORM-EXIT写法如下,执行结果会有很大不同。若写法如下,可能是程序退出点,但因为未正确书写“THRUXXXX-TEST-PROFORM-EXIT”,则程序不会执行该段,导致程序无法退出。
XXXX-TEST-PROFORM-EXIT.
GOBACK./STOP RUN.
测试程序如下:
PROCEDURE DIVISION.
*
MAIN-ROUTINE.
*
DISPLAY 'MAIN ROUTINE START'.
*
PERFORM A-ROUTINE
THRU A-ROUTINE-EXIT
*
DISPLAY '== START EXEC A-C ROUTINE =='.
PERFORM A-ROUTINE
THRU C-ROUTINE-EXIT
DISPLAY '== END EXEC A-C ROUTINE =='.
*
PERFORM B-ROUTINE
THRU B-ROUTINE-EXIT
*
PERFORM C-ROUTINE
THRU C-ROUTINE EXIT
DISPLAY 'C-ROUTINE EXIT IN MAIN'.
*
PERFORM C-ROUTINE
THRU C-ROUTINE-EXIT
DISPLAY 'C-ROUTINE-EXIT IN MAIN'.
*
PERFORM D-ROUTINE
THRU D-ROUTINE-EXIT
*
DISPLAY 'MAIN ROUTINE END'.
MAIN-ROUTINE-EXIT.
STOP RUN.
*
A-ROUTINE.
DISPLAY 'EXEC A ROUTINE'.
A-ROUTINE-EXIT.
DISPLAY 'EXEC A ROUTINE EXIT'.
EXIT.
*
B-ROUTINE.
DISPLAY 'EXEC B ROUTINE'.
B-ROUTINE-EXIT.
DISPLAY 'EXEC B ROUTINE EXIT'.
EXIT.
*
C-ROUTINE.
DISPLAY 'EXEC C ROUTINE'.
C-ROUTINE-EXIT.
DISPLAY 'C-ROUTINE-EXIT IN C'.
EXIT.
*
D-ROUTINE.
DISPLAY 'EXEC D ROUTINE'.
D-ROUTINE-EXIT.
DISPLAY 'EXEC D ROUTINE EXIT'.
EXIT.
*
执行结果如下:
MAIN ROUTINE START
EXEC A ROUTINE
EXEC A ROUTINE EXIT
== START EXEC A-C ROUTINE ==
EXEC A ROUTINE
EXEC A ROUTINE EXIT
EXEC B ROUTINE
EXEC B ROUTINE EXIT
EXEC C ROUTINE
C-ROUTINE-EXIT IN C
== END EXEC A-C ROUTINE ==
EXEC B ROUTINE
EXEC B ROUTINE EXIT
EXEC C ROUTINE
C-ROUTINE EXIT IN MAIN
EXEC C ROUTINE
C-ROUTINE-EXIT IN C
C-ROUTINE-EXIT IN MAIN
EXEC D ROUTINE
EXEC D ROUTINE EXIT
MAIN ROUTINE END
转自:http://hi.baidu.com/clisdena/item/01857711271c686c70d5e8d0
3,
IDENTIFICATION DIVISION.
PROGRAM-ID. PGM012.
AUTHOR. MAINFRAMEWIZARD.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-SUB PIC 9(3) VALUE ZEROS.
PROCEDURE DIVISION.
10000-MAIN-PARA.
PERFORM 20000-FIRST-PARA THRU 30000-THIRD-PARA
DISPLAY 'DEPICTING PERFORM THRU BY MAINFRAMEWIZARD.COM'
DISPLAY 'PARA NAME IS 10000-FIRST-PARA'
STOP RUN.
20000-FIRST-PARA.
DISPLAY 'PARA NAME IS 20000-FIRST-PARA'.
25000-SECOND-PARA.
DISPLAY 'PARA NAME IS 25000-SECOND-PARA'.
30000-THIRD-PARA.
DISPLAY 'PARA NAME IS 30000-THIRD-PARA'
Output of the above program is as below
PARA NAME IS 20000-FIRST-PARA
PARA NAME IS 25000-SECOND-PARA
PARA NAME IS 30000-THIRD-PARA
DEPICTING PERFORM THRU BY MAINFRAMEWIZARD.COM
PARA NAME IS 10000-FIRST-PARA
- See more at: http://www.mainframewizard.com/content/cobol-perform-thru#sthash.SBBE20eI.dpuf
测试:
MOVE 5 TO WK-INPUT
MOVE 5 TO WK-OUTPUT
或者
MOVE -5 TO WK-INPUT
MOVE -5 TO WK-OUTPUT
COMPUTE WK-OUTPUT = + WK-INPUT
执行结果:WK-OUTPUT结果为5.
COMPUTE WK-OUTPUT = - WK-INPUT
执行结果:WK-OUTPUT结果为5.
2、THRU笔误:编译测试均通过
以下包括THRU执行流程、THRU笔误执行测试。
如下笔误:
…… ==> 该部分代码正常执行
PERFORM XXXX-TEST-PREFORM
THRU XXXX-TEST-PREFORM EXIT ==> 红色字为COBOL关键字 不执行XXXX-TEST-PROFORM-EXIT
…… ==> 该部分代码正常执行
XXXX-TEST-PROFORM-EXIT.
EXIT.
上述语句编译成功,不影响正常程序流,程序执行步骤完全一致,所有测试全部通过。
EXIT语句,其实就是标识而已,不起作用。
若XXXX-TEST-PROFORM-EXIT写法如下,执行结果会有很大不同。若写法如下,可能是程序退出点,但因为未正确书写“THRUXXXX-TEST-PROFORM-EXIT”,则程序不会执行该段,导致程序无法退出。
XXXX-TEST-PROFORM-EXIT.
GOBACK./STOP RUN.
测试程序如下:
PROCEDURE DIVISION.
*
MAIN-ROUTINE.
*
DISPLAY 'MAIN ROUTINE START'.
*
PERFORM A-ROUTINE
THRU A-ROUTINE-EXIT
*
DISPLAY '== START EXEC A-C ROUTINE =='.
PERFORM A-ROUTINE
THRU C-ROUTINE-EXIT
DISPLAY '== END EXEC A-C ROUTINE =='.
*
PERFORM B-ROUTINE
THRU B-ROUTINE-EXIT
*
PERFORM C-ROUTINE
THRU C-ROUTINE EXIT
DISPLAY 'C-ROUTINE EXIT IN MAIN'.
*
PERFORM C-ROUTINE
THRU C-ROUTINE-EXIT
DISPLAY 'C-ROUTINE-EXIT IN MAIN'.
*
PERFORM D-ROUTINE
THRU D-ROUTINE-EXIT
*
DISPLAY 'MAIN ROUTINE END'.
MAIN-ROUTINE-EXIT.
STOP RUN.
*
A-ROUTINE.
DISPLAY 'EXEC A ROUTINE'.
A-ROUTINE-EXIT.
DISPLAY 'EXEC A ROUTINE EXIT'.
EXIT.
*
B-ROUTINE.
DISPLAY 'EXEC B ROUTINE'.
B-ROUTINE-EXIT.
DISPLAY 'EXEC B ROUTINE EXIT'.
EXIT.
*
C-ROUTINE.
DISPLAY 'EXEC C ROUTINE'.
C-ROUTINE-EXIT.
DISPLAY 'C-ROUTINE-EXIT IN C'.
EXIT.
*
D-ROUTINE.
DISPLAY 'EXEC D ROUTINE'.
D-ROUTINE-EXIT.
DISPLAY 'EXEC D ROUTINE EXIT'.
EXIT.
*
执行结果如下:
MAIN ROUTINE START
EXEC A ROUTINE
EXEC A ROUTINE EXIT
== START EXEC A-C ROUTINE ==
EXEC A ROUTINE
EXEC A ROUTINE EXIT
EXEC B ROUTINE
EXEC B ROUTINE EXIT
EXEC C ROUTINE
C-ROUTINE-EXIT IN C
== END EXEC A-C ROUTINE ==
EXEC B ROUTINE
EXEC B ROUTINE EXIT
EXEC C ROUTINE
C-ROUTINE EXIT IN MAIN
EXEC C ROUTINE
C-ROUTINE-EXIT IN C
C-ROUTINE-EXIT IN MAIN
EXEC D ROUTINE
EXEC D ROUTINE EXIT
MAIN ROUTINE END
转自:http://hi.baidu.com/clisdena/item/01857711271c686c70d5e8d0
3,
IDENTIFICATION DIVISION.
PROGRAM-ID. PGM012.
AUTHOR. MAINFRAMEWIZARD.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-SUB PIC 9(3) VALUE ZEROS.
PROCEDURE DIVISION.
10000-MAIN-PARA.
PERFORM 20000-FIRST-PARA THRU 30000-THIRD-PARA
DISPLAY 'DEPICTING PERFORM THRU BY MAINFRAMEWIZARD.COM'
DISPLAY 'PARA NAME IS 10000-FIRST-PARA'
STOP RUN.
20000-FIRST-PARA.
DISPLAY 'PARA NAME IS 20000-FIRST-PARA'.
25000-SECOND-PARA.
DISPLAY 'PARA NAME IS 25000-SECOND-PARA'.
30000-THIRD-PARA.
DISPLAY 'PARA NAME IS 30000-THIRD-PARA'
Output of the above program is as below
PARA NAME IS 20000-FIRST-PARA
PARA NAME IS 25000-SECOND-PARA
PARA NAME IS 30000-THIRD-PARA
DEPICTING PERFORM THRU BY MAINFRAMEWIZARD.COM
PARA NAME IS 10000-FIRST-PARA
- See more at: http://www.mainframewizard.com/content/cobol-perform-thru#sthash.SBBE20eI.dpuf
相关推荐
- **显示结果**:排序后,通过`PERFORM A-ST THRU A-SE VARYING Q FROM 1 BY 1 UNTIL P = 0`循环显示删除后的链表。 **2. 关键代码解释** - **PERFORM DEL THRU E-D UNTIL DEL-DATA = 99**:用于从链表中删除元素...
6. **控制流程**:COBOL提供了一系列控制流程语句,如IF-THEN-ELSE、PERFORM、THRU等,用于实现条件判断、循环和其他控制逻辑。 7. **子程序与链接**:MS-COBOL 2.1 支持子程序(Subprogram)的概念,可以通过`...
谭浩强COBOL_A 谭浩强COBOL_A谭浩强COBOL_A谭浩强COBOL_A谭浩强COBOL_A谭浩强COBOL_A
Notepad++自带中文,支持众多计算机程序语言: C,C++,Java,pascal,C#,XML,SQL,HTML,PHP,ASP, 汇编, DOS批处理, Caml, COBOL, Cmake, CSS,ActionScript, Fortran, Gui4Cli, Haskell, INNO, JSP, KIXtart, LISP, Lua, ...
cobol语言入门cobol语言入门------------
- IF...THEN...ELSE、PERFORM、THRU、WHEN、AT...OF等语句用于流程控制。 - GOTO语句虽然存在,但在现代编程实践中不推荐使用,因为它可能导致难以维护的代码。 5. **文件操作** - 在COBOL中,文件处理是核心...
| | +-- BPublicClass.h | +-- module2 |-- src | |-- module1 | | |-- Makefile | | |-- BPublicClassImpl.h | | |-- BPublicClassImpl.cc | | +-- BPublicClass.cc | +-- module2 |-- test | |-- module1 | | +-- ...
`IF`、`EVALUATE`和`WHENEVER`用于条件控制,`GOTO`用于无条件跳转,`EXIT`语句用于提前退出程序段或循环。 5. **字符串操作**: - `STRING`指令用于将一个字符串复制到另一个字符串,支持指定起始位置和长度。`...
- **(1)** `MOVE -1 TO WK-A`:将-1移动到`WK-A`中,由于`WK-A`定义为`Z99`,所以`WK-A`的值为`-01`。 - **(2)** `MOVE 7890 TO WK-A`:尝试将7890移动到`WK-A`中,但`WK-A`只能容纳两位数字,因此溢出,实际...
COBOL,全称Common Business Oriented Language,是一种专门针对商业应用设计的编程语言,尤其在数据管理和商业数据处理领域有着广泛的应用。由于其语法结构接近英语,理解相对容易,因此也被誉为“用于管理的语言”...
"COBOL-85简明教程" COBOL-85 简明教程是 COBOL 编程语言的入门指南,旨在帮助读者快速掌握 COBOL 编程的基础知识。下面是该教程的概要: COBOL 语言简介 COBOL 语言的历史可以追溯到 1960 年,最初是由 CODASYL...
- Cobol有丰富的流程控制语句,如IF-THEN-ELSE,PERFORM,THRU,GOTO等,以及条件和循环结构。 - 使用WORKING-STORAGE SECTION来声明和管理临时变量。 6. **文件操作** - Cobol在数据处理上表现出色,支持顺序...
### COBOL学习总结 #### 一、简介 近期为了更好地进行后台编程工作,我们开始深入研究COBOL语言的相关知识,并对其中一些实用的语法进行了归纳总结。本文旨在帮助团队成员快速掌握这些要点,从而在实际编程过程中...
5. **控制流程**:COBOL支持条件语句(IF-THEN-ELSE)、循环(PERFORM)和分支(GO TO)。例如,一个简单的条件判断: ```cobol IF EMPLOYEE-AGE > 60 DISPLAY "Employee is eligible for retirement." ELSE ...
### COBOL教程知识点详述 #### COBOL语言概览 COBOL,全称Common Business Oriented Language,是一种面向商业数据处理的高级编程语言。由于其在数据管理和处理领域的广泛应用,COBOL也被誉为“管理者的语言”。该...
【Cobol案例分析】——银行计算机系统建设 在银行计算机系统建设中,Cobol(COmmon Business Oriented Language)是一种常见的编程语言,因其在处理事务处理系统(如银行系统)上的强大功能和稳定性而被广泛使用。...
- 利用COBOL的内置功能,如使用COMPUTE或MOVE CORRESPONDING简化操作。 8. **测试与调试**: - 编写单元测试,确保每个模块的功能正确。 - 使用调试工具,如IBM的TDA(Transaction Development Assistant),...
4. **输入/输出(I/O)处理**:COBOL85提供了丰富的I/O语句,如ACCEPT和DISPLAY,用于从终端接收用户输入或者将结果显示在终端上。此外,还可以通过FILE-CONTROL和FILE-STATUS来管理文件的打开、关闭和错误处理。 5...