cobol

Errors in if Statement

霸气de小男生 提交于 2019-12-12 01:55:32
问题 I'm getting the following errors in one, but not both, of my if statements. 165 IGYPS2000-S Expected a data-name, but found "TO". The "ADD" statement was discarded. 169 IGYPS2096-S An incomplete condition was found in a conditional expression. The operand(s) was(were) discarded. 169 IGYPS2079-S Expected a verb or "NEXT SENTENCE", but found ""F"". The statement was discarded. IF MARITAL-STATUS-IN = "S" ADD 1 TO SINGLE-COUNT ADD 1 TO OVERALL-COUNT ADD SALARY-IN TO SINGLE-TOTAL ADD SALARY-IN TO

Numeric field accepting characters in cics map

故事扮演 提交于 2019-12-12 01:32:04
问题 I have 4 fields in my map which are 9(6),9(3),9(3),9(3). I wrote validation code like this: IF ROLLNUM IS NOT NUMERIC MOVE DFHRED TO ROLLNUMC MOVE 'INVALID DATA' TO RESMSGO MOVE ROLLNUMI TO ROLLNUMO PERFORM SEND-MAP THRU SEND-MAP-EXIT PERFORM KEY-VALIDATION THRU KEY-VALIDATION-EXIT. But I am not getting any kind of error while inserting the values like A12AK into the database from cics. It is replacing A with 1, B with 2, and so on... Why is this happening? And how to avoid this 回答1: Add

COBOL programmers - How to use arrays

a 夏天 提交于 2019-12-11 21:12:32
问题 I am programming in COBOL and trying to put this client file in an array. I'm having trouble understanding this problem. I know that the array would probably be based on the bookingtype because there are 4 different options. Any help would be appreciated. This is how I have the array defined so far: 01 Booking-Table. 05 BookingType OCCURS 4 TIMES PIC 9. Here is the client file. 回答1: I guess the solution is about storing the costs in an array. To calculate the average the array would need to

Indexed File Processing in Cobol error?

可紊 提交于 2019-12-11 18:15:28
问题 I have the following code for processing an indexed file but I am getting a runtime error, "indexed file system not available" when I run the program. I'm not sure on how to code the index file and the data file though. Am I doing the initialization right? What am doing wrong? IDENTIFICATION DIVISION. PROGRAM-ID. INDEXFILE. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT VENDOR-FILE ASSIGN TO DISK ORGANIZATION IS INDEXED ACCESS MODE IS RANDOM RECORD KEY IS VENDOR-NUMBER. DATA

Programs hangs when opening COBOL Indexed file

半城伤御伤魂 提交于 2019-12-11 17:54:08
问题 I've recently started a COBOL course and, because of my computer configuration ( Windows 7 64 Bits and GNU/Linux 64Bits) I have to use Dosbox to compile and execute programs. Everything is going well but, I'n finding some troubles when I try to open an Indexed file , either I-O or Ouput mode. I can compile and link but at execution time, dosbox get frozen. My compiler version is MS-COBOL 5.0 and DosBox is 0.74 (last version). Does anybody have had this issue? Can someone tell how to fix it.

Data Validation

让人想犯罪 __ 提交于 2019-12-11 14:44:49
问题 So I have entered my second semester of College and they have me doing a course called Advanced COBOL. As one of my assignments I have to my make a program that tests certain things in a file to make sure the input has no errors. I get the general idea but there are just a few things I don't understand and my teacher is one of those people who will give you an assignment and make you figure it out yourself with little or no help. So here is what I need help with. I have a field that the first

calling a COBOL program from a C program, ERROR LNKG2019: unresolved external symbol _verkoop referenced in function _main

这一生的挚爱 提交于 2019-12-11 13:47:46
问题 I'm calling a COBOL program from a C program, but I keep getting following error: ERROR LNKG2019: unresolved external symbol _verkoop referenced in function _main. Here is my C program: #include <stdio.h> #include "libcob.h" //#pragma linkage (verkoop, COBOL) extern void verkoop(char *productid, char *aantal); int main(int argc, char *argv[]) { char *productid = "000020"; char *aantal = "000200"; COB_RTD = cob_get_rtd(); cob_init(rtd, 0, NULL); printf("Hello world"); verkoop(productid, aantal

Pattern for reading a sequential input file

让人想犯罪 __ 提交于 2019-12-11 12:22:23
问题 I've been seeing a lot of examples for reading a sequential file in COBOL that looks something like this: FD File-Record 01 Input-Record. 88 End-Of-File VALUE HIGH-VALUES. 05 ... ... READ File-Record AT END SET End-Of-File TO TRUE END-READ PERFORM UNTIL End-Of-File PERFORM Process-Record READ File-Record AT END SET End-Of-File TO TRUE END-READ END-PERFORM One question is, would it be just as well to process it as follows? PERFORM UNTIL End-Of-File READ File-Record AT END SET End-Of-File TO

How do I process a sequential file with two different types of records?

我与影子孤独终老i 提交于 2019-12-11 09:58:56
问题 For an assignment as part of a COBOL course, my input file is a sequential file called BRANCHTOT.SEQ with two types of records: The first is what I call a header record that states the total amount of records in the file (excluding the header record itself). This is only one record. If this were to be the only record in the file, I'd define it as follows: 01 header-record. 03 record-count PIC 9(6). 03 FILLER PIC X(13). The second type of records are the records I will have to read and process

Dot rules in nested conditional statements - COBOL

流过昼夜 提交于 2019-12-11 09:47:15
问题 I'm wondering if anybody can explain to me the dot ruling in nested IF statements in COBOL. Example: *The first if statement* IF SUCCESSFUL-STATUS PERFORM 8300-REPL-LNNTBI00 THRU 8300-REPL-LNNTBI00-EXIT *The second if statement* IF SUCCESSFUL-STATUS DISPLAY 'RECORD ALREADY UPDATED :' WS-INF-REC ELSE DISPLAY 'UPDATE ERROR : ' WS-INF-REC ' / ' WS-RETURN-STATUS READ INFILE INTO WS-INF-REC. Which if statement does the dot placed after "WS-INF-REC" belong to? The first IF or the second IF-ELSE? I