Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What's wrong with my program?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
chenxuehua

New User


Joined: 28 Nov 2005
Posts: 14
Location: Shanghai China

PostPosted: Tue Nov 29, 2005 7:11 pm    Post subject: What's wrong with my program?
Reply with quote

the system tells me:

No "SELECT" statement was specified for file "MYPS-FILE"
definition was discarded.

IGYPS2121-S "WS-PS-EOF" was not defined as a data-name.
An error was found in the definition of file "MYPS-FILE"
to this file was discarded.

that's my error, but I have defined MYPS-FILE.
Back to top
View user's profile Send private message

radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Tue Nov 29, 2005 7:27 pm    Post subject:
Reply with quote

not sure to find the errors in your program unless we see it.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Tue Nov 29, 2005 7:29 pm    Post subject: Re: what' wrong with my programm?
Reply with quote

Quote:
that's my error,but i have defined MYPS-FILE.


Then better you also post your code....

Regards,

Priyesh.
Back to top
View user's profile Send private message
chenxuehua

New User


Joined: 28 Nov 2005
Posts: 14
Location: Shanghai China

PostPosted: Wed Nov 30, 2005 5:24 pm    Post subject: Re: What's wrong with my program?
Reply with quote

ok that's my program
Code:

ENVIRONMENT DIVISION.
      *
      * OPTIONAL SECTION
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
          SELECT  MYSORT-FILE
               ASSIGN TO MYSORT. 
           SELECT  MYPS-FILE
               ASSIGN TO MYPS                                           FORM
               ORGANIZATION IS SEQUENTIAL
               ACCESS MODE IS SEQUENTIAL
               FILE STATUS WS-FILE-STATUS.
       DATA DIVISION.
       FILE SECTION.
       SD  MYSORT-FILE
           RECORD CONTAINS 80 CHARACTERS
           LABEL RECORDS IS MYSORT-DATA.   
       01  MYSORT-DATA.
           03  MY-SORT-KEY             PIC X(04).
           03  MY-SORT-TEXT            PIC X(76).
       FD  MYPS-FILE
           RECORD CONTAINS 80 CHARACTERS
           LABEL RECORDS ARE STANDARD.
       01  MYPS-DATA.
           03  MY-PS-KEY             PIC X(04).
           03  MY-PS-TEXT            PIC X(76).

WORKING-STORAGE SECTION.
       01  WS-MYWORKING-AREA.
           03  WS-FILE-STATUS.                                          SX12011
               05  WS-VSAM-STATUS    PIC XX.                            SX12011
                   88  WS-VSAM-FILE-EOF          VALUE '10'.            SX12011
                   88  WS-VSAM-FILE-OK           VALUE '00'.            SX12011

       PROCEDURE DIVISION.

       AA000-MAIN            SECTION.                                 

  SORT-TESTING.

           SORT MYSORT-FILE
           ON ASCENDING KEY MY-SORT-KEY
           INPUT PROCEDURE 600-SORT3-INPUT
           OUTPUT PROCEDURE 700-SORT3-OUTPUT.

           IF SORT-RETURN IS NOT EQUAL TO 00
               DISPLAY 'SORT-RETURN = ' SORT-RETURN.

       600-SORT3-INPUT.

           PERFORM 500-OPEN-PS-FILE

           MOVE 'N'   TO WS-PS-STATUS

           PERFORM 501-PS-READ WITH TEST BEFORE UNTIL WS-PS-EOF

           CLOSE MYPS-FILE
           .
       700-SORT3-OUTPUT.
           MOVE 'N'   TO WS-SORT-STATUS
           PERFORM UNTIL WS-SORT-EOF
               RETURN MYSORT-FILE RECORD
                   AT END
                       MOVE 'Y'             TO WS-SORT-STATUS
               END-RETURN
               IF NOT WS-SORT-EOF
                   DISPLAY 'OUTPUT MY-SORT-KEY = ' MY-SORT-KEY
               END-IF
           END-PERFORM
           .
       500-OPEN-PS-FILE.
           OPEN I-O    MYPS-FILE

           DISPLAY ' OPEN PS FILE = ' WS-FILE-STATUS

           IF WS-FILE-STATUS NOT = '00'
               DISPLAY 'OPEN PS FILE ERROR '
               MOVE 48   TO RETURN-CODE
               STOP RUN
           END-IF.

       501-PS-READ.
           READ MYPS-FILE
           IF WS-FILE-STATUS NOT = '00'
               IF WS-FILE-STATUS  = '10'
                   SET WS-PS-EOF TO TRUE
               ELSE
                   DISPLAY 'READ PS FILE ERROR '
                   MOVE 49   TO RETURN-CODE
                   STOP RUN
               END-IF
           ELSE
      *        MOVE MYPS-DATA TO MYSORT-DATA
               RELEASE MYSORT-DATA FROM MYPS-DATA
               DISPLAY 'INPUT MYSORT-RECORD = ' MYSORT-DATA
           END-IF.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Nov 30, 2005 7:05 pm    Post subject: Re: What's wrong with my program?
Reply with quote

chenxuehua wrote:

IGYPS2121-S "WS-PS-EOF" was not defined as a data-name.

I'll agree with this error message. You don't have a definition for WS-PS-EOF in your WORKING-STORAGE.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Nov 30, 2005 9:45 pm    Post subject: Re: What's wrong with my program?
Reply with quote

I'm assuming that many of the problems with the code you supplied is due to the cut and paste into the example you supplied.

Many times, errors as you describe are caused from very simple editing mistakes. A misplaced period is a common problem, once this happens the compiler sometimes doesn?t interrupt following statements as you would expect.

I found the following were not defined in the code example:


"WS-PS-STATUS" WAS NOT DEFINED AS A DATA-NAME.
"WS-PS-EOF" WAS NOT DEFINED AS A DATA-NAME.
"WS-SORT-STATUS" WAS NOT DEFINED AS A DATA-NAME.
"WS-SORT-EOF" WAS NOT DEFINED AS A DATA-NAME.

When I compiled your program I did NOT get the message for the select statement. So either your example is not exactly what you compiled, or you may be using a different compiler. Or when I edited your code I inadvertently corrected the problem.

Let us know.

icon_smile.gif
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Nov 30, 2005 9:55 pm    Post subject: Re: What's wrong with my program?
Reply with quote

I got the same results as DavidatK here.
Back to top
View user's profile Send private message
chenxuehua

New User


Joined: 28 Nov 2005
Posts: 14
Location: Shanghai China

PostPosted: Fri Dec 02, 2005 7:10 am    Post subject:
Reply with quote

thank you! I'm a new learner,here.
Back to top
View user's profile Send private message
chenxuehua

New User


Joined: 28 Nov 2005
Posts: 14
Location: Shanghai China

PostPosted: Fri Dec 02, 2005 7:16 am    Post subject:
Reply with quote

let me try again
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us