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
 

 

Error message in FASTSRT compiler option

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

New User


Joined: 30 Apr 2007
Posts: 7
Location: pune

PostPosted: Tue Jun 19, 2007 8:48 pm    Post subject: Error message in FASTSRT compiler option
Reply with quote

hi,

i am running a sort program in COBOL but in compiler i am getting a message:

SORT SORT-FILE ON ASCENDING KEY W-STUDENTENTENTID
USING STUDENT
GIVING FRESULT.

File "STUDENT" in the "USING" phrase of the "SORT" statement was accepted as being eligibile for the FASTSRT compiler option.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jun 19, 2007 11:35 pm    Post subject:
Reply with quote

Hello,

When you post a message, the message number should be posted with it.

I believe what you received is only informational and not an error.
Back to top
View user's profile Send private message
sh_moni
Currently Banned

New User


Joined: 30 Apr 2007
Posts: 7
Location: pune

PostPosted: Wed Jun 20, 2007 5:47 pm    Post subject: Re: Error message in FASTSRT compiler option
Reply with quote

My cobol Code :

Code:
IDENTIFICATION DIVISION.               
PROGRAM-ID. ASSIGN17.                 
ENVIRONMENT DIVISION.                 
INPUT-OUTPUT SECTION.                 
FILE-CONTROL.                         
       SELECT STUDENT ASSIGN TO DD2.   
       SELECT SORT-FILE ASSIGN TO DD3.
       SELECT FRESULT ASSIGN TO DD4.   
DATA DIVISION.                         
FILE SECTION.                         
FD STUDENT                             
    RECORDING MODE IS F               
    RECORD CONTAINS 80 CHARACTERS.     
01 STUDENTDETAILS.                     
    02  STUDENTID PIC 9(7).           
    02  STUDENTNAME.                   
       03 SURNAME       PIC X(8).     
       03 INITIALS      PIC XX.       
    02  DATEOFBIRTH.                   
       03 YOBIRTH       PIC 9(4).     
       03 MOBIRTH       PIC 9(2).     
       03 DOBIRTH       PIC 9(2).     
    02  COURSECODE      PIC X(2).     
    02  GRANT           PIC 9(2).     
    02  GENDER          PIC X.         
    02                  PIC X(50).     
SD SORT-FILE.                         
01 SORT-DETAILS.                       
    02  W-STUDENTID       PIC 9(7).   
    02                    PIC X(73).   
FD FRESULT                             
    RECORDING MODE IS F               
    RECORD CONTAINS 80 CHARACTERS.     
01 FINALDETAILS.                       
    02  F-STUDENTID PIC 9(7).         
    02              PIC X(73).         
 01 WS-WORK-AREAS.                                     
     05 ARE-THERE-MORE-RECORDS   PIC X(3) VALUE 'YES'.
 PROCEDURE DIVISION.                                   
 BEGIN.                                               
     OPEN INPUT  STUDENT.                             
     OPEN OUTPUT FRESULT.                             
     PERFORM UNTIL ARE-THERE-MORE-RECORDS = 'NO'       
     READ STUDENT                                     
        AT END                                         
           MOVE 'NO' TO ARE-THERE-MORE-RECORDS         
        NOT AT END                                     
           PERFORM SORT-OF-FILES                       
     END-READ                                         
     END-PERFORM.                                           
     CLOSE STUDENT.                                   
     CLOSE FRESULT.                                   
     STOP RUN.                                         
 SORT-OF-FILES.                                         
     MOVE STUDENTDETAILS TO SORT-DETAILS                       
     SORT SORT-FILE ON ASCENDING KEY W-STUDENTID       
        USING STUDENT                                 
        GIVING FRESULT.                             


The error message I am getting For This is as below.

A logic error occurred. Neither FILE STATUS nor a declarative was specified for at relative location X'071A'. The status code was 41.
From compile unit ASSIGN17 at entry point ASSIGN17 at compile unit offset +00000 at address 09300BFA.


What i understand is the program is failing at the SORT step that's why it is giving file status 41 when next time i am trying to run the program.But can somebody enlighten me about the Logic error as i dont find anything wrong in the code.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 20, 2007 5:57 pm    Post subject:
Reply with quote

Hello,

When you post an error, please post your jcl and the diagnostic info for the compile and the run - do not type them into the post, copy/paste them.

This problem is caused by trying to use files in the sort that are already open. You cannot name files in SORT that are already in use in the code elsewhere.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Jun 20, 2007 5:58 pm    Post subject:
Reply with quote

FS 41 is opening a file already open. With the sort using, you should not open the file, sort will do it.
Try it this way:
Code:
BEGIN.                                               
     SORT SORT-FILE ON ASCENDING KEY W-STUDENTID       
        USING STUDENT                                 
        GIVING FRESULT.                             
     STOP RUN.                                         

By the way, since you are doing nothing to the records, why COBOL, why not just sort utility?
Back to top
View user's profile Send private message
sh_moni
Currently Banned

New User


Joined: 30 Apr 2007
Posts: 7
Location: pune

PostPosted: Wed Jun 20, 2007 9:40 pm    Post subject: HI
Reply with quote

Many thanks William. icon_razz.gif
Sorry Dick I am quite new both to mainframes and this forum so please ignore my faults.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jun 21, 2007 12:29 am    Post subject:
Reply with quote

Hi Manoj,

Not to worry - we're here to help with both the mainframe and the forum:)
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 REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm


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