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
 

 

file status 90 and going in infinie loop

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

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Tue Apr 29, 2008 7:04 pm    Post subject: file status 90 and going in infinie loop
Reply with quote

My INPUT FILE
===============
8712351SMITH MS19671012LM51F
8712352POWER TG19681219LM51M
8712353SWEENEY ST19690905LM52M
8712354WALSH SM19700313LM60M
===============================

Code:

IDENTIFICATION DIVISION.                     
PROGRAM-ID. UNSTRNGP.                       
ENVIRONMENT       DIVISION.                 
INPUT-OUTPUT       SECTION.                 
FILE-CONTROL.                               
         SELECT VARRECFILE ASSIGN TO VARLEN 
             ORGANIZATION IS SEQUENTIAL
             FILE STATUS IS WS-FILE-STATUS. 
DATA DIVISION.                               
FILE SECTION.                               
FD VARRECFILE.                               
01 VARLENREC.                               
      02  SID             PIC 9(7).         
      02  NAME.                             
          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(4).       
      02  GENDER          PIC X.         
      02  FILLER          PIC X(91).     
WORKING-STORAGE SECTION.                 
01  WS-MESSAGES.                         
        10  WS-FILE-STATUS   PIC X(02).   
PROCEDURE DIVISION.                       
BEGIN.                                   
    DISPLAY 'INSIDE'.                     
    OPEN INPUT VARRECFILE.
    DISPLAY 'FILE STATUS'  WS-FILE-STATUS.
    READ VARRECFILE                       
      AT END MOVE HIGH-VALUES TO VARLENREC. 
    CLOSE VARRECFILE.                     
    END-READ.                             
    DISPLAY 'AFTER READ'.                 
    DISPLAY 'VARLENREC'  VARLENREC                           
    PERFORM UNTIL VARLENREC = HIGH-VALUES                 
      DISPLAY 'INSIDE PERFORM'                             
      DISPLAY SID SPACE NAME SPACE COURSECODE SPACE YOBIRTH
      DISPLAY 'AFTER DISP VAL'                             
   END-PERFORM                                           
STOP RUN.           


When I'm running this its going in infinite loop? What to do and its not generating the output in display statement " DISPLAY SID SPACE NAME SPACE COURSECODE SPACE YOBIRTH"
Back to top
View user's profile Send private message

ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Tue Apr 29, 2008 7:18 pm    Post subject:
Reply with quote

pls chk file status 90

[url]

http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.langref.doc/c0925395700.htm

[/url]
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Apr 29, 2008 8:34 pm    Post subject:
Reply with quote

Quote:
READ VARRECFILE
AT END MOVE HIGH-VALUES TO VARLENREC.
CLOSE VARRECFILE.
END-READ.
DISPLAY 'AFTER READ'.
DISPLAY 'VARLENREC' VARLENREC
PERFORM UNTIL VARLENREC = HIGH-VALUES
DISPLAY 'INSIDE PERFORM'
DISPLAY SID SPACE NAME SPACE COURSECODE SPACE YOBIRTH
DISPLAY 'AFTER DISP VAL'
END-PERFORM

When you close varrecfile then you nolonger have access to varlenrec. If you had access to varlenrec there is nothing inside your perform loop that would ever change its value so you would be in a infinite loop. I'm surprised you aren't getting an abend.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Apr 29, 2008 8:39 pm    Post subject:
Reply with quote

Program logic?
OPEN INPUT VARRECFILE.
Open the file...
DISPLAY 'FILE STATUS' WS-FILE-STATUS.
READ VARRECFILE
AT END MOVE HIGH-VALUES TO VARLENREC.
Read the first reord.
Of at least one record is there, no high-values....
CLOSE VARRECFILE.
Loose the file.
END-READ.
Kind of dumb?
DISPLAY 'AFTER READ'.
DISPLAY 'VARLENREC' VARLENREC
PERFORM UNTIL VARLENREC = HIGH-VALUES
perform until HV, which is it not
DISPLAY 'INSIDE PERFORM'
DISPLAY SID SPACE NAME SPACE COURSECODE SPACE YOBIRTH
DISPLAY 'AFTER DISP VAL'
display stuff....
END-PERFORM
Go back to the inline perform and do it again, over and over 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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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