cobol

COBOL code to replace characters by html entities

瘦欲@ 提交于 2020-01-06 06:52:17
问题 I want to replace the characters '<' and '>' by < and > with COBOL. I was wondering about INSPECT statement, but it looks like this statement just can be used to translate one char by another. My intention is to replace all html characters by their html entities. Can anyone figure out some way to do it? Maybe looping over the string and testing each char is the only way? GnuCOBOL or IBM COBOL examples are welcome. My best code is something like it: (http://ideone.com/MKiAc6) IDENTIFICATION

Group variable in cobol

南笙酒味 提交于 2020-01-04 06:21:13
问题 01 g1. 05 h1 PIC X VALUE 'N'. 88 s1 VALUE 'Y'. 88 s2 VALUE 'N'. In the above code what will be the value of s1 and s2? whether it holds the value given in the group variable(05) or it will have their own values? 回答1: S1 and S1 are named conditions. They will be true or not true depending upon the value of H1 (or G1 in this case). The code: Set S1 to true will cause the value of H1 (and G1 in the case of your specific group) to be 'Y'. If you execute: Set S2 to true the value of H1 (and G1

Group variable in cobol

放肆的年华 提交于 2020-01-04 06:21:10
问题 01 g1. 05 h1 PIC X VALUE 'N'. 88 s1 VALUE 'Y'. 88 s2 VALUE 'N'. In the above code what will be the value of s1 and s2? whether it holds the value given in the group variable(05) or it will have their own values? 回答1: S1 and S1 are named conditions. They will be true or not true depending upon the value of H1 (or G1 in this case). The code: Set S1 to true will cause the value of H1 (and G1 in the case of your specific group) to be 'Y'. If you execute: Set S2 to true the value of H1 (and G1

Bison: GLR-parsing of valid expression fails without error message

和自甴很熟 提交于 2020-01-04 06:12:40
问题 I'm working on a GLR-parser in GNU bison and I have the following problem: the language I'm trying to parse allows boolean expressions including relations (<,>,<=,...) and boolean composition (and, or, not). Now the problem is that the language also allows to have multiple arithmetic expressions on the right side of a relation... and they are composed using the same AND token that is used for boolean composition! This is a very dumb language-design, but I can't change it. So you can have a >

How To Read a Date in Java from a COMP-3 field in COBOL?

亡梦爱人 提交于 2020-01-04 05:44:08
问题 I am trying to read a COBOL data file using JRecord, in that I have a Header record and Detail record, so I parsed with SPLIT_01_LEVEL and CopyBook File format as FMT_OPEN_COBOL. I have few date fields in the flat file as COMP-3 fields, and I am unable to understand on how to convert them into Java Date fields. ICobolIOBuilder iob = CobolIoProvider.getInstance() .newIOBuilder(copybookName) .setCopybookFileFormat(Convert.FMT_OPEN_COBOL) .setSplitCopybook(CopybookLoader.SPLIT_01_LEVEL); //I

How to write SQLite callback in COBOL

﹥>﹥吖頭↗ 提交于 2020-01-03 09:25:12
问题 I'm a COBOL programmer , and my latest project is to connect a COBOL application to a SQLite3 database. I have been following this guide, and their solution is exactly what I would need in my COBOL application. I have successfully managed to create, connect, insert data and close the database, but the problem arises when I try to select data from the database. In the tutorial, they use a callback with double pointers. static int callback(void *NotUsed, int argc, char **argv, char **azColName)

Cobol v6.2 NUMCHECK option compatibility

北城余情 提交于 2020-01-03 03:18:08
问题 We can't turn off the NUMCHECK option for our new COBOL V6.2 compiler because we can't trust the content of our numeric variables. The problem is, that when we turn it on, it's not fully compatible with the COBOL 4 we had previously at our organization. Specifically - when an unsigned packed variable contains X'123C' , COBOL 4 would have accepted it and let us continue, but COBOL 6.2 with NUMCHECK(PAC,ABD) abends, and only willing to accept X'123F'. This is a real issue for us regarding

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

自古美人都是妖i 提交于 2019-12-31 06:35:12
问题 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

cobol difference with Picture having a dash (-) and a having a X

夙愿已清 提交于 2019-12-31 03:20:09
问题 What are the differences between the 2 pictures below? PIC X(15) PIC ----,---,---.99. Is the bottom just another way to represent the top? 回答1: PIC X(15) Represents 15 characters of virtually any type of data, could be digits, letters or any other symbol (printable or not). PIC ----,---,---.99 Represents a numeric edited data item capable of holding values in the range +999999999.99 through -999999999.99. This item will display a leading minus sign if the value placed into it is negative,

How to “sleep” in mainframe COBOL?

血红的双手。 提交于 2019-12-30 16:20:33
问题 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? 回答1: Probably the easiest method is to use the Language Environment callable service CEE3DLY or CEEDLYM. 回答2: 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