IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FILE HANDLING Error: No "SELECT" statement was spe


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
PRABHATH
Warnings : 1

New User


Joined: 08 Jun 2006
Posts: 28
Location: hyderabad

PostPosted: Mon May 07, 2007 4:50 pm
Reply with quote

Hi i m new to COBOL and trying out with FILE HANDLING...I am not able to compile this pgm and not able to understand the proper reason for error...

I m pasting both my cobol pgm and the compile JCL i m using...also the error i m getting with this..can anyone please let me know the mistake i m doin here...

Code:

       IDENTIFICATION DIVISION.                           
       PROGRAM-ID. SEQF.                                 
       ENVIRONMENT DIVISION.                             
       INPUT-OUTPUT SECTION.                             
         FILE-CONTROL.                                   
           SELECT SEQFILE ASSIGN TO DD1                   
             ORGANIZATION IS SEQUENTIAL.                 
       DATA DIVISION.                                     
       FILE SECTION.                                     
       FD SEQFILE.                                       
       01  SEQREC.                                       
           02 EMPNO PIC X(6).                             
           02 EMPNAME PIC X(15).                         
           02 DESG PIC X(10).                             
           02 AGE PIC 99.                                 
           02 DEPT PIC X(8).                             
           02 FILLER PIC X(39).                           
       WORKING-STORAGE SECTION.                           
       01  EOF PIC X.                                     
       PROCEDURE DIVISION.                                   
       MAIN-PARA.                                             
           OPEN OUTPUT SEQFILE.                               
           PERFORM ACCPARA 3 TIMES.                           
           PERFORM CLOSEPARA.                                 
       ACCPARA.                                               
           ACCEPT EMPNO.                                     
           ACCEPT EMPNAME.                                   
           ACCEPT DESG.                                       
           ACCEPT AGE.                                       
           ACCEPT DEPT.                                       
           WRITE SEQREC.                                     
       CLOSEPARA.                                             
           CLOSE SEQFILE.                                     
           MOVE ZEROS TO RETURN-CODE.                         
           STOP RUN.


Compile JCL:

Code:
                                         
//*                                                                     
/*JOBPARM L=999,SYSAFF=(Z05A)
//COMPILE EXEC PGM=IGYCRCTL,
//             PARM='LIB,NOADV,APOST,DYNAM,NOFDUMP,RENT,RES,NOAWO',     
//             REGION=600K                                             
//STEPLIB  DD  DSN=SYS1.COB2COMP,DISP=SHR                               
//*                                                                     
//SYSUT1   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))                             
//SYSUT2   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))                             
//SYSUT3   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))                             
//SYSUT4   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))                             
//SYSUT5   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))                             
//SYSUT6   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))                             
//SYSUT7   DD  UNIT=SYSDA,SPACE=(CYL,(1,1))                             
//*                                                                     
//SYSIN    DD  DSN=TOSGPG.COBOL.PGM(SEQF),DISP=SHR                     
//SYSLIN   DD  DSN=&&SYSLIN,                                           
//             DISP=(,PASS),                                           
//             UNIT=SYSDA,SPACE=(CYL,(1,1)),                           
//             DCB=BLKSIZE=3200                                         
//SYSPRINT DD  SYSOUT=*                                                 
//**********************************************************************
//*                   LINKEDIT                                         *
//**********************************************************************
//LINK    EXEC PGM=HEWL,                                               
//             PARM='XREF,AMODE=24,RMODE=24',                           
//             COND=(5,LT)                                             
//SYSPRINT DD  SYSOUT=*                                                 
//SYSUT1   DD  SPACE=(CYL,(1,1)),UNIT=SYSDA                             
//SYSLIN   DD  DSN=&&SYSLIN,DISP=(OLD,DELETE)                           
//*                                                                     
//SYSLIB   DD  DSN=SYS1.COB2LIB,DISP=SHR                               
//SYSLMOD  DD  DSN=TOSGPG.COBOL.LOAD(SEQF),DISP=SHR                     
//SYSIN    DD  DUMMY


here are the errors:

10 IGYGR1232-S No "SELECT" statement was specified for file "SEQFILE".The file definition was discarded.

22 IGYPS2052-S An error was found in the definition of file "SEQFILE".
The reference to this file was discarded.
Same message on line: 33
31 IGYPS2053-S An error was found in the definition of file "SEQFILE".
This input/output statement was discarded.

34 IGYSC0136-E Program "CBLPGM02" required an "END PROGRAM" statement at "END PROGRAM" statement at this point in the program. An "END PROGRAM" statement was assumed.
34 IGYSC0136-E Program "CBLPGM01" required an "END PROGRAM" statement at "END PROGRAM" statement at this point in the program. An "END PROGRAM"


Please let me know the problem for this...
statement was assumed.
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Mon May 07, 2007 5:18 pm
Reply with quote

Read the note in the following link and find for urself what's the issue :-)....U need to focus on the syntax more

http://www.cs.wright.edu/people/faculty/rrea/ch2.html

Regards
Syam
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon May 07, 2007 8:02 pm
Reply with quote

Hmm. Compiled OK for me.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon May 07, 2007 10:25 pm
Reply with quote

Hello,

Look thru your code and make sure you have keyed the code in the proper columns. In just this bit of code, there are 2 changes i'd make. . .
Code:
       INPUT-OUTPUT SECTION.                             
         FILE-CONTROL.                                   
           SELECT SEQFILE ASSIGN TO DD1                   
             ORGANIZATION IS SEQUENTIAL.                 
       DATA DIVISION.                                     
       FILE SECTION.                                     
       FD SEQFILE.         


The FILE-CONTROL and the FD. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top