sponsored links

Collapse

Announcement

Collapse
No announcement yet.

Read Not Working

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read Not Working

    Hi,

    Could someone please help me understand why read is not working!

    there is record in file with EMPID = 100001, but program displays blank output.

    Code:
           IDENTIFICATION DIVISION.               
           PROGRAM-ID. PGM1.                      
    
           ENVIRONMENT DIVISION.                  
           INPUT-OUTPUT SECTION.                  
           FILE-CONTROL.                          
               SELECT EMP-FILE ASSIGN TO DISK-EMPF
               ORGANIZATION IS INDEXED            
               ACCESS MODE IS DYNAMIC             
               RECORD KEY IS EMPID                
               FILE STATUS IS FILE-STATUS.        
           DATA DIVISION.                         
           FILE SECTION.                          
           FD  EMP-FILE                           
               LABEL RECORDS ARE STANDARD.        
    
           01  EMP-REC.                      
               COPY DDS-ALL-FORMATS OF EMPF. 
    
           WORKING-STORAGE SECTION.          
           77 FILE-STATUS PIC XX.            
    
           PROCEDURE DIVISION.               
               OPEN INPUT EMP-FILE.          
               MOVE 100001 TO EMPID.         
               READ EMP-FILE.                
               DISPLAY "FIRST NAME : " FNAME.
           END-PGM.                          
               STOP RUN.

  • #2
    Did you look up the value in FILE-STATUS? That's where I would start.

    Comment


    • #3
      At file open, status is 90, after read status is 92.

      Comment


      • #4
        Now look up those codes.

        https://www.ibm.com/support/knowledg...tuskeyvals.htm

        You might also look for messages in the job log.


        Comment

        sponsored links

        Collapse

        Working...
        X