Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Error : Reading input from seq dataset

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

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Fri Apr 21, 2006 3:07 pm    Post subject: Error : Reading input from seq dataset
Reply with quote

Hi all,
Any body can help me to solve this problem..
I tried to call input file using seq dataset.
But in the program, it error in looping portion..
Pls feel free to see my pgm..
Code:
       DATE-WRITTEN.   11/08/2112.
      *****************************************************************
      *                                                               *
      ** ENVIRONMENT DIVISION.                                        *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       SKIP1
      *****************************************************************
      *                                                               *
      ** CONFIGURATION SECTION.                                       *
      *                                                               *
      *****************************************************************
       CONFIGURATION SECTION.
       SKIP1
      *****************************************************************
      *                                                               *
      ** INPUT-OUTPUT SECTION.                                        *
      *                                                               *
      *****************************************************************
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT TEXT-TABLE
                ASSIGN TO TEXTTBL
                FILE STATUS IS WK-FILE-STATUS.
       EJECT
      *****************************************************************
      *                                                               *
      ** DATA DIVISION.                                               *
      *                                                               *
      *****************************************************************
       DATA DIVISION.
       SKIP1
      *****************************************************************
      *                                                               *
      ** FILE SECTION.                                                *
      *                                                               *
      *****************************************************************
       FILE SECTION.
       SKIP1
      *****************************************************************
      *                                                               *
      ** FILE DESCRIPTION -                                           *
      *  BANK-TBL IS A INPUT SETTLEMENT REPORT FILE                   *
      *                                                               *
      *****************************************************************
       FD  TEXT-TABLE
           LABEL RECORDS ARE STANDARD
           RECORDING MODE F.
        01  TEXT-TBL-REC.
            05  C402S-TEXT-NAME                 PIC X(05).
            05  FILLER                          PIC X(75).
       EJECT
      *****************************************************************
      *                                                               *
      ** BEGINING OF WORKING-STORAGE SECTION.                         *
      *                                                               *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  FILLER                              PIC  X(50)
                                   VALUE
              'WORKING STORAGE FOR IBG400F BEGINS HERE'.
       EJECT
      *01  CENTURY-FORMAT.                     COPY COPYCNTY.
      *****************************************************************
      *                                                               *
      ** CONSTANTS.                                                   *
      *  READ ONLY CONSTANTS.                                         *
      *                                                               *
      *****************************************************************
       SKIP2
       01  KN-CONSTANTS.
           05  KN-ERROR-MESSAGE.
               20  KN-MSG-TEXT                 PIC X(60).
               20  KN-ABEND-CODE               PIC X(04).
           05  KN-ASTERISK-LINE                PIC X(65)
                                   VALUE ALL '*'.
       EJECT
      *****************************************************************
      *                                                               *
      ** WORK AREAS.                                                  *
      *                                                               *
      *****************************************************************
       SKIP2
       01  WK-AREAS.
           05  WK-FILE-STATUS                  PIC X(02).
           05  C400S-ALPHA-CODE                PIC X(05).
           05  SW-END-TBL                      PIC X(01).
               88  SW-EOF-TBL    VALUE 'Y'.
               88  SW-NEOF-TBL   VALUE 'N'.
       EJECT
      *****************************************************************
      *                                                               *
      ** END OF WORKING STORAGE CONSTANT.                             *
      *                                                               *
      *****************************************************************
       01  FILLER                              PIC  X(50)
                                   VALUE
              'WORKING STORAGE FOR IBG400F ENDS HERE'.
       EJECT
      *****************************************************************
      *                                                               *
      ** PROCEDURE DIVISION.                                          *
      *                                                               *
      *****************************************************************
       PROCEDURE DIVISION.

       0000-MAINLINE.

           PERFORM 1000-INITIALIZE      THRU 1000-EXIT.
           DISPLAY 'INITIALIZE DONE.
           PERFORM 2000-MAIN-PROCESS    THRU 2000-EXIT
                   UNTIL SW-EOF-TBL.
           PERFORM 9000-CLOSE-FILE      THRU 9000-EXIT.
           STOP RUN.

       0000-EXIT.
           EXIT.
       EJECT
      *****************************************************************
   
       SKIP1
       1000-INITIALIZE.
           INITIALIZE WK-AREAS
                      KN-CONSTANTS
                      SW-END-TBL.

           PERFORM 1500-OPEN-ALL-FILES THRU 1500-EXIT.
       1000-EXIT.
           EXIT.
       EJECT

       1500-OPEN-ALL-FILES.
           OPEN INPUT TEXT-TABLE.
           IF WK-FILE-STATUS NOT = '00'
              MOVE 'INVALID OPEN INPUT TEXTTBL'   TO  KN-MSG-TEXT
              MOVE WK-FILE-STATUS                 TO  KN-ABEND-CODE
              PERFORM 9999-CALL-ABEND THRU 9999-EXIT.
       1500-EXIT.
           EXIT.
       EJECT
     
      *****************************************************************
       SKIP1
       2000-MAIN-PROCESS.

           READ TEXT-TABLE
              AT END MOVE 'Y' TO SW-END-TBL.
         MOVE C402S-TEXT-NAME      TO C400S-ALPHA-CODE 
              DISPLAY 'FILE NAME ' C400S-ALPHA-CODE.
 
       2000-EXIT.
           EXIT.
       SKIP1
      *****************************************************************
      *****************************************************************
       SKIP1
       9000-CLOSE-FILE.

           CLOSE TEXT-TABLE.
           IF WK-FILE-STATUS NOT =  '00'
              MOVE 'INVALID CLOSE INPUT TABLE'    TO  KN-MSG-TEXT
              MOVE WK-FILE-STATUS                 TO  KN-ABEND-CODE
              PERFORM 9999-CALL-ABEND THRU 9999-EXIT.

       9000-EXIT.
           EXIT.
       EJECT
   
      *****************************************************************
      *                                                               *
      *  THIS SECTION IS TO DISPLAY THE ERROR MESSAGE WHEN THE IS     *
      *  A FAILURE OF THE PROCESS                                     *
      *                                                               *
      *****************************************************************
       SKIP1
       9999-CALL-ABEND.
           MOVE ALL '*' TO KN-ASTERISK-LINE.
           DISPLAY KN-ASTERISK-LINE.
           DISPLAY 'PROGRAM NAME  : IBG400F'.
           DISPLAY 'ERROR MESSAGE : ' KN-MSG-TEXT.
           DISPLAY 'ABEND CODE    : ' KN-ABEND-CODE.
           DISPLAY KN-ASTERISK-LINE.
           MOVE KN-ABEND-CODE  TO RETURN-CODE.
       9999-EXIT.
           EXIT.
       EJECT



I got this error when i compile this program..

Code:

   121  IGYPS0007-E   A nonnumeric literal was not properly continued.  The end of the literal was assumed on the last source line.


It is in lineThe error is in line
Code:
PERFORM 2000-MAIN-PROCESS    THRU 2000-EXIT
                   UNTIL SW-EOF-TBL.


My intention to do this program is to display content in the dataset only..
Back to top
View user's profile Send private message

nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Fri Apr 21, 2006 4:05 pm    Post subject:
Reply with quote

Hi,

There was one minor bugs in this code

1)One was after perform 1000-INITIALIZE paragraph
DISPLAY 'INITIALIZE DONE.

the display statement does not has a matching QUOTATION mark. this might lead to this error when compiling.

2) At this code MOVE C402S-TEXT-NAME TO C400S-ALPHA-CODE terminate this line with a Full stop

This should work after these corrections
Back to top
View user's profile Send private message
hariavinash

New User


Joined: 04 Jan 2006
Posts: 64

PostPosted: Fri Apr 21, 2006 4:14 pm    Post subject:
Reply with quote

push the following code another 4 columns

MOVE C402S-TEXT-NAME TO C400S-ALPHA-CODE

otherwise you will get this error..
"MOVE" should not begin in area "A".

other than that code looks good.
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Fri Apr 21, 2006 5:23 pm    Post subject:
Reply with quote

Hi,


Put closing closing quotes for the display st.
And push the move statement to the 12th column.Move st should begin in area A.

Thanks,
KS
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Mon Apr 24, 2006 8:20 am    Post subject:
Reply with quote

Ok..thank you..I miss Full Stop.Then ok when i compile
One more thing..When i run this program using JCL, i see there in infinite looping..
This is my JCL
Code:
//STEP0001 EXEC PGM=PGRM1                                             
//STEPLIB  DD  DISP=SHR,DSN=&SYSUID..LOAD                               
//BANKTBL  DD  DSN=SYS1001.TBANK,DISP=SHR                           
//SYSOUT   DD SYSOUT=*             


SYS1001.TBANK is my input data..contain name of bank..[/code]
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Mon Apr 24, 2006 9:00 am    Post subject: Re: Error : Reading input from seq dataset
Reply with quote

Ok..I soleved this problem..
But i got 1 logic error..
In my inout file, there is 4 data which is
bank1
bank2
bank3
bank4

But i got output
bank1
bank2
bank3
bank4
bank4

The program looped twice in the last record..How to control this?
Back to top
View user's profile Send private message
prakash271082

New User


Joined: 09 Sep 2005
Posts: 53

PostPosted: Mon Apr 24, 2006 9:32 am    Post subject:
Reply with quote

Hi,

Check for SW-END-TBL NOT EQUAL TO 'Y', then move the value and display it.
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Tue Apr 25, 2006 2:55 pm    Post subject: Re: Error : Reading input from seq dataset
Reply with quote

Hi,

Change the initialized value in the declaration of the variable.
ie - Change as below :

05 SW-END-TBL PIC X(01).
88 SW-EOF-TBL VALUE 'N'
88 SW-NEOF-TBL VALUE 'N'.


Now infinite loop will not happen.
Above given solution is also right.

Thanks,
KS
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us