Welcome to civicforums.com!
Welcome to
civicforums.com .
You are currently viewing our forum as a guest, which gives you limited access to view most discussions and access our other features. By joining our community,
at no cost , you will have access to start new topics, reply to conversations, privately message other members (PM), respond to polls, upload content and access many other special features. Registration is free, fast and simple, so please
join civicforums.com today !
03-21-2004
#1 (permalink )
Welcome To Prime Time, BITCH!
Join Date: Aug 2002
Location: Livingston, Tennessee, US
Age: 29
Posts: 1,964
Anyone know Cobol Programming? Please Help.
We have to take a sequential file and convert it to an indexed file. I have only one error in my program and I can not figure out what I have done wrong someone please help. On line 46 it shows that I have a conditional statement when there should be an imperative statement.
1 IDENTIFICATION DIVISION.
2 PROGRAM-ID. CONVERT.
3 AUTHOR. ERIK COPE.
4 DATE-WRITTEN. 03/21/04.
5 ENVIRONMENT DIVISION.
6 INPUT-OUTPUT SECTION.
7 FILE-CONTROL.
8 SELECT CUST-MASTER-IN ASSIGN TO "cust-master.file"
9 ORGANIZATION IS LINE SEQUENTIAL.
10 SELECT INDEXED-CUSTMASTER-OUT ASSIGN TO "indexed-custmaster.file"
11 ORGANIZATION IS INDEXED
12 ACCESS IS SEQUENTIAL
13 RECORD KEY IS INDEXED-COMPANY-NAME.
14 DATA DIVISION.
15 FILE SECTION.
16 FD CUST-MASTER-IN.
17 01 CUSTMASTER-REC-IN.
18 05 COMPANY-NAME PIC X(15).
19 05 CUSTOMER-NUMBER PIC X(6).
20 05 ADDRESS-IN.
21 10 STREET-IN PIC X(15).
22 10 CITY-IN PIC X(15).
23 10 STATE-IN PIC X(2).
24 10 ZIP-IN PIC X(5).
25 05 ACCOUNT-BALANCE PIC 99999999V99.
26 05 ACCOUNT-INTEREST-RATE PIC V99.
27 FD INDEXED-CUSTMASTER-OUT.
28 01 CUSTMASTER-REC-OUT.
29 05 INDEXED-COMPANY-NAME PIC X(15).
30 05 INDEXED-CUSTOMER-NUMBER PIC X(6).
31 05 INDEXED-ADDRESS-IN.
32 10 INDEXED-STREET-IN PIC X(15).
33 10 INDEXED-CITY-IN PIC X(15).
34 10 INDEXED-STATE-IN PIC X(2).
35 10 INDEXED-ZIP-IN PIC X(5).
36 05 INDEXED-ACCOUNT-BALANCE PIC 999999999V99.
37 05 INDEXED-ACCOUNT-INTEREST-RATE PIC V99.
38 WORKING-STORAGE SECTION.
39 01 WS-WORK-AREAS.
40 05 ARE-THERE-MORE-RECORDS PIC X(3) VALUE 'YES'.
41 88 NO-MORE-RECORDS VALUE 'NO '.
42 PROCEDURE DIVISION.
43 100-MAIN-MODULE.
44 PERFORM 300-INITIALIZATION-RTN
45 PERFORM UNTIL NO-MORE-RECORDS
46 READ CUST-MASTER-IN
........1
%COBOL-E-CNDNOGOOD, (1) Conditional statement detected - Imperative statement required
47 AT END
48 MOVE 'NO ' TO ARE-THERE-MORE-RECORDS
49 NOT AT END
50 PERFORM 200-CREATE-RTN
51 PERFORM 400-END-OF-JOB-RTN
52 END-PERFORM
53 STOP RUN.
54 200-CREATE-RTN.
55 MOVE CUSTMASTER-REC-IN TO CUSTMASTER-REC-OUT
56 WRITE CUSTMASTER-REC-OUT
57 INVALID KEY DISPLAY "INVALID RECORD ", CUSTMASTER-REC-IN
58 END-WRITE.
59 300-INITIALIZATION-RTN.
60 OPEN INPUT CUST-MASTER-IN
61 OUTPUT INDEXED-CUSTMASTER-OUT.
62 400-END-OF-JOB-RTN.
63 CLOSE CUST-MASTER-IN
64 INDEXED-CUSTMASTER-OUT. To remove this ad, register today for free or log in if already registered!
__________________
The Evil Squirrels are after my nuts!!!
Check my ride. Quote:
It's not premarital sex if you don't plan on getting married.
Sponsored Links To avoid seeing this ad in our forum please register at CivicForums.com By joining our free community you will have access to post topics, respond to polls, upload content and access many other special features.
03-21-2004
#2 (permalink )
Welcome To Prime Time, BITCH!
Join Date: Aug 2002
Location: Livingston, Tennessee, US
Age: 29
Posts: 1,964
nevermind, found the problem. Had a read statement, but no end-read statement.
oh well.
__________________
The Evil Squirrels are after my nuts!!!
Check my ride. Quote:
It's not premarital sex if you don't plan on getting married.
10-21-2008
#3 (permalink )
New Member
Join Date: Oct 2008
Location: Vienna, VA
Age: 24
Posts: 3
Re: Anyone know Cobol Programming? Please Help.
I hope you don't mind me looking over a bit of your code. I'm trying to learn COBOL myself.
11-06-2008
#4 (permalink )
Member
Join Date: Nov 2008
Age: 23
Posts: 133
Re: Anyone know Cobol Programming? Please Help.
Same hear. I am looking a bit of your code.
Tags 3210 , civic , cobol , cobolecndnogood , code , conditional , cope , detected , erik , honda , imperative , pic , required , statement , x5bb
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off