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
 

 

Displaying file records on screen

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nutan

New User


Joined: 27 Jan 2006
Posts: 26

PostPosted: Mon Jan 30, 2006 5:01 pm    Post subject: Displaying file records on screen
Reply with quote

Hi,
I am writting COBOL program of file and displaying that file contents on screen. for this I wrote JCL stmt . Prog is executing properly but o/p it is displaying is not complete. It means file contains records like,

abcdefghijklmnopqrstuvwxyz
12345678901234567890123

O/P on screen is :

abcdefghijklmnopqrstuvwxyz

It is not displaying complete o/p . I have mentioned EOF also.

Regards,
Nutan
Back to top
View user's profile Send private message

nutan

New User


Joined: 27 Jan 2006
Posts: 26

PostPosted: Tue Jan 31, 2006 1:08 pm    Post subject:
Reply with quote

HI ,
I tried using 2 read stmts also. But it is noe displaying 2nd o/p .
COBOL prog is :
Code:


       IDENTIFICATION DIVISION.
       PROGRAM-ID. CHINU .
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT INFILE ASSIGN TO IN1
           ORGANIZATION IS SEQUENTIAL.
       DATA DIVISION.
       FILE SECTION.
       FD INFILE
           LABEL RECORD ARE STANDARD
           VALUE OF FILE-ID IS 'IN1.TXT'.
       01 IN-REC PIC X(80).
       WORKING-STORAGE SECTION.
       01 EOF PIC X VALUE IS 'N'.
       01 NUM PIC X(80).
       PROCEDURE DIVISION.
           OPEN INPUT INFILE.
           READ INFILE AT END MOVE 'Y' TO EOF.
           MOVE IN-REC TO NUM.
           DISPLAY NUM.
           STOP RUN.


JCL stmt is :
Code:

//JOB1 JOB
//STEP1 EXEC PGM=CHINU
//IN1 DD DSN=IN1.TXT,DISP=(SHR,CATLG,CATLG)


Regards,
Nutan
Back to top
View user's profile Send private message
MichaelKBS

New User


Joined: 10 Jan 2006
Posts: 24
Location: Germany

PostPosted: Tue Jan 31, 2006 2:49 pm    Post subject: Re: Displaying file records on screen
Reply with quote

Where is the loop in your program?

You have to insert a PERFORM UNTIL EOF - Routine to read and display all of the Input.
Back to top
View user's profile Send private message
Mane Sagar

New User


Joined: 12 Jul 2005
Posts: 41
Location: mumbai

PostPosted: Tue Jan 31, 2006 2:58 pm    Post subject: Re: Displaying file records on screen
Reply with quote

Hi Nutan,

You can write a process para UNTIL EOF after the READ para and then again at the end in the process para can read the input file again.
This will make ur program to excute till the EOF.

Rgds,
Sagar
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Tue Jan 31, 2006 3:04 pm    Post subject:
Reply with quote

You have to add one loop in your procedure division like


OPEN INPUT INFILE.
PERFORM PARA1 UNTIL EOF = 'Y'.
PARA1.
READ INFILE AT END MOVE 'Y' TO EOF GOTO CLOSEPARA.
MOVE INREC TO NUM.
DISPALY NUM.
CLOSEPARA.
CLOSE INFILE.
STOP RUN.
Back to top
View user's profile Send private message
nutan

New User


Joined: 27 Jan 2006
Posts: 26

PostPosted: Tue Jan 31, 2006 4:52 pm    Post subject:
Reply with quote

HI,
Thanks for your support. Only the thing I forgot is to add a loop which I have added into my program and now able to execute my program .
Thanks a lot .

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

Moderator Team Head


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

PostPosted: Wed Feb 01, 2006 12:30 am    Post subject: Re: Displaying file records on screen
Reply with quote

nutan, it is not the purpose of these forums to assist you in debugging and/or testing your code. That is for you to take care of first. Please do not continue to abuse the Forums in this manner.

Also, please use the CODE tags around your code to make it easier to read and understand.
Back to top
View user's profile Send private message
pa1chandak
Currently Banned

New User


Joined: 31 Jan 2006
Posts: 55

PostPosted: Wed Feb 01, 2006 4:47 pm    Post subject:
Reply with quote

hi nutan
the only problem is , you dint mention the NOT AT END CONDITION.

WHEN USING AT END do give NOT AT END.AND DONT PUT DOT
THAT IS TERMINATOR IN BETWEEN OK.

LIKE

OPEN INPUT INFILE.
READ INFILE AT END MOVE 'Y' TO EOF
NOT AT END
MOVE IN-REC TO NUM
DISPLAY NUM
END READ.
STOP RUN.

THIS WILL WORK SURELY
OK

PAWAN C.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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