cobol

How do I identify the level of a field in copybook using JRecord in Java?

风流意气都作罢 提交于 2019-12-02 10:27:09
I am trying to read a EBCDIC file and convert it to ASCII format in Java, with a help of copybook. I am using JRecord to read the copybook. So now, how do I get the field level from the copybook using JRecord? Edit 1: Kindly excuse me for a vague question. I have no experience in mainframe or cobol. I am adding few more details if it could help. My source file contains multiple transaction details. The copybook contains the information on the transaction and the fields relating to that particular transaction. I have to split the each transaction and its fields to a separate file(containing one

What is a control break? (COBOL)

≯℡__Kan透↙ 提交于 2019-12-02 07:26:26
OK so I'm taking an online COBOL class now and this week the content is control break and control field... For previous lectures I can understand easily but I have no idea what this lecture talks about. What is a control field and what's the usage? Thanks. Here are the lecture websites: http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u1/index.html http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u2/index.html http://flashserver.ait.iastate.edu/shchang/cobol/chapter10/chapter10u3/index.html A Control Field is a field which indicates how data is grouped.

How to replace spaces at the right into zeros at the left in COBOL?

我只是一个虾纸丫 提交于 2019-12-02 06:09:33
问题 I have an alphanumeric variable with a length of 10. It contains a number at the beginning, the rest of the digits are filled with spaces. Then I need to move the string to the left and put the number of spaces with '0' at the begining. This examples speaks for themselves: INPUT OUTPUT ============================== '123456 ' -> '0000123456' '12345678 ' -> '0012345678' '123456789 ' -> '0123456789' '1234567890' -> '1234567890' Then I tought in something like this: Check this COBOL fiddle where

compute length string of variable with cobol

爷,独闯天下 提交于 2019-12-02 04:20:24
问题 I have a NOTE in database table How can i calculate the length of that string? I have a variable defined like 10 NOTE. 49 NOTE-LEN PIC S9(4) USAGE COMP. 49 NOTE-TEXT PIC X(500). Note is a string of 500 characters. I want to compute the note length. 回答1: Here's a common way: MOVE ZERO TO count-of-trailing-spaces INSPECT FUNCTION REVERSE ( NOTE-TEXT ) TALLYING count-of-trailing-spaces FOR LEADING SPACE SUBTRACT count-of-trailing-spaces FROM LENGTH OF ( NOTE-TEXT ) GIVING NOTE-LEN FUNCTION

AS/400: Using COMPUTE function, inconsistent results with different field definition

こ雲淡風輕ζ 提交于 2019-12-01 20:08:46
I have faced a mysterious problem while using the COMPUTE function in AS/400. The scenario is as follows: 01 WSAA-AMOUNT-A PIC S9(15)V9(02) COMP-3. 01 WSAA-AMOUNT-B-01 PIC S9(16)V9(02) VALUE 0. 01 WSAA-AMOUNT-B-02 PIC S9(13)V9(05) VALUE 0. 01 WSAA-AMOUNT-C PIC S9(16)V9(02) VALUE 0. 01 WSAA-RESULT PIC S9(15)V9(02) VALUE 0. MOVE 2500.87 TO WSAA-AMOUNT-A. MOVE 12285 TO WSAA-AMOUNT-B-01. MOVE 12285 TO WSAA-AMOUNT-B-02. MOVE 4387.5 TO WSAA-AMOUNT-C. COMPUTE WSAA-RESULT ROUNDED = (WSAA-AMOUNT-A / ( WSAA-AMOUNT-B-01 + WSAA-AMOUNT-C) * 100 ). DISPLAY WSAA-RESULT. COMPUTE WSAA-RESULT ROUNDED = (WSAA

AS/400: Using COMPUTE function, inconsistent results with different field definition

北慕城南 提交于 2019-12-01 20:00:53
问题 I have faced a mysterious problem while using the COMPUTE function in AS/400. The scenario is as follows: 01 WSAA-AMOUNT-A PIC S9(15)V9(02) COMP-3. 01 WSAA-AMOUNT-B-01 PIC S9(16)V9(02) VALUE 0. 01 WSAA-AMOUNT-B-02 PIC S9(13)V9(05) VALUE 0. 01 WSAA-AMOUNT-C PIC S9(16)V9(02) VALUE 0. 01 WSAA-RESULT PIC S9(15)V9(02) VALUE 0. MOVE 2500.87 TO WSAA-AMOUNT-A. MOVE 12285 TO WSAA-AMOUNT-B-01. MOVE 12285 TO WSAA-AMOUNT-B-02. MOVE 4387.5 TO WSAA-AMOUNT-C. COMPUTE WSAA-RESULT ROUNDED = (WSAA-AMOUNT-A / (

How to “sleep” in mainframe COBOL?

北城以北 提交于 2019-12-01 14:21:08
I think I'm using Enterprise COBOL for z/OS. What's a technique to emulate the functionality of, for example, the standard C library's sleep() function? Probably the easiest method is to use the Language Environment callable service CEE3DLY or CEEDLYM . Modern Coding I don't know whether you have found your answer or not. There is an IBM program that enables the machine to sleep ... or to wait : its name is ILBOWAT0 . Here is the link of a very good example on how you can code it : http://www.mvsforums.com/helpboards/viewtopic.php?t=2008&highlight=delay In this example, WAIT-TIME is in seconds

Variable with usage COMP in COBOL

本小妞迷上赌 提交于 2019-12-01 11:58:30
I am trying to understand how the COBOL variables with COMP Usage clause stores values. I tried one example as below 01 VAR14 PIC S9(5) USAGE COMP. MOVE 12345 TO VAR14 DISPLAY VAR14 In SPOOL the value of VAR14 is coming as 0000012345 . S9(5) COMP size is 4 bytes as per manuals so my understanding is VAR14 should be displayed as 000012345 . The binary representation as below: 0000 0000 0000 0000 0011 0000 0011 0100‬ Can someone please help in understanding the output value 0000012345 ? Thanks In IBM's Enterprise COBOL, there are four ways to define a binary field: COMP; COMP-4; BINARY; COMP-5.

Variable with usage COMP in COBOL

对着背影说爱祢 提交于 2019-12-01 10:43:25
问题 I am trying to understand how the COBOL variables with COMP Usage clause stores values. I tried one example as below 01 VAR14 PIC S9(5) USAGE COMP. MOVE 12345 TO VAR14 DISPLAY VAR14 In SPOOL the value of VAR14 is coming as 0000012345 . S9(5) COMP size is 4 bytes as per manuals so my understanding is VAR14 should be displayed as 000012345 . The binary representation as below: 0000 0000 0000 0000 0011 0000 0011 0100‬ Can someone please help in understanding the output value 0000012345 ? Thanks

Printing in two columns

 ̄綄美尐妖づ 提交于 2019-12-01 07:51:35
问题 We are supposed to form an array of names that occur 108 times. We are supposed to have name 1-54 in a left column and names 55-108 in a right column. After there have been 108 names for one page, we initialize our array and start over again. The output for my code is showing names 1-54 printed and, instead of being on the same page and beside names 1-54, names 55-108 in the right column but after names 1-54. Any thoughts would be greatly appreciated. Here is some of my code: PERFORM UNTIL