View previous topic :: View next topic
|
Author |
Message |
chenxuehua
New User
Joined: 28 Nov 2005 Posts: 14 Location: Shanghai China
|
|
|
|
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 |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
not sure to find the errors in your program unless we see it. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
that's my error,but i have defined MYPS-FILE. |
Then better you also post your code....
Regards,
Priyesh. |
|
Back to top |
|
|
chenxuehua
New User
Joined: 28 Nov 2005 Posts: 14 Location: Shanghai China
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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.
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I got the same results as DavidatK here. |
|
Back to top |
|
|
chenxuehua
New User
Joined: 28 Nov 2005 Posts: 14 Location: Shanghai China
|
|
|
|
thank you! I'm a new learner,here. |
|
Back to top |
|
|
chenxuehua
New User
Joined: 28 Nov 2005 Posts: 14 Location: Shanghai China
|
|
|
|
let me try again |
|
Back to top |
|
|
|