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

Displaying file records on screen


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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
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
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

Global Moderator


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

PostPosted: Wed Feb 01, 2006 12:30 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top