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

Problem in input read...


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Nov 20, 2007 4:57 pm
Reply with quote

Hi All,
I am running a COBOL program which reads an input file and creates two reports as output. But just after reading the input file, I have put some display like -
Code:

READ INPUT-FILE INTO LBC005-SUB-BILL-IO-AREA   
    AT END                                     
      GO TO 700-CONTROL-RPT.                   
      GO TO 650-SUMMARY-RPT.                   
ADD 1      TO   WS-INPUT-READ.                 
                                               
DISPLAY 'INPUT-REC='   LBC005-SUB-BILL-IO-AREA

The display is giving some absurd values at some particular position and at a specific record. I have checked the input file but that record is not having any issue at all. It is coming fine when I open it using its copybook. But while reading then why it is coming with some junk values? The file is also not in pack on status-it is in "PACK OFF" profile. Ohh! I am using the following JCL to run my program -
Code:

//JSTEP01 EXEC PGM=IEFBR14                                 
//DD01    DD DSN=SYSPGRP.XA2C.UAC.ADUNNAGE.LBR066,         
//     DISP=(MOD,DELETE,DELETE),                           
//     SPACE=(TRK,(1,1),RLSE)                             
//DD02    DD DSN=SYSPGRP.XA2C.UAC.ADUNNAGE.LBR067,         
//     DISP=(MOD,DELETE,DELETE),                           
//     SPACE=(TRK,(1,1),RLSE)                             
//DD03    DD DSN=SYSPGRP.XA2C.P06.LB.LBW062.SORT,         
//     DISP=(MOD,DELETE,DELETE),                           
//     SPACE=(TRK,(1,1),RLSE)                             
//*********************************************************
//JSTEP02 EXEC PGM=SYNCSORT                               
//SORTIN DD DSN=SYSPGRP.XA2C.P06.LB.LBW062.G02,DISP=SHR   
//SORTOUT DD DSN=SYSPGRP.XA2C.P06.LB.LBW062.SORT,         
//   DISP=(NEW,CATLG,DELETE),                               
//   SPACE=(CYL,(20,10),RLSE),                               
//   DCB=(RECFM=FB,LRECL=300,BLKSIZE=3000)                   
//SYSPRINT DD SYSOUT=*                                       
//SYSOUT DD SYSOUT=*                                         
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK06 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK07 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK08 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK09 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SORTWK10 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSIN DD *                                                 
    SORT FIELDS=(27,1,CH,A,158,1,CH,A,191,7,ZD,D)           
//********************************************************************
//JSTEP03 EXEC PGM=LBP073                                             
//STEPLIB DD DSN=SYSPGRP.XA2C.SYS2.LINKLIB,DISP=SHR                   
//DFSVSAMP DD DSN=SYSPGRP.XA2C.SYS2.CTLCDS(LBP073V),DISP=SHR         
//INPFILE DD DSN=SYSPGRP.XA2C.P06.LB.LBW062.SORT,                     
//     DISP=SHR                                                       
//DETLRPT DD DSN=SYSPGRP.XA2C.UAC.ADUNNAGE.LBR066,                   
//     DISP=(NEW,CATLG,DELETE),                                       
//     SPACE=(CYL,(10,10),RLSE),                                     
//     DCB=(RECFM=FB,LRECL=133,BLKSIZE=1330)                         
//CNTLRPT DD DSN=SYSPGRP.XA2C.UAC.ADUNNAGE.LBR067,                   
//     DISP=(NEW,CATLG,DELETE),                                       
//     SPACE=(CYL,(10,10),RLSE),                                     
//     DCB=(RECFM=FB,LRECL=133,BLKSIZE=1330)                         
//*******  ERD # 014K ********                                       
//SYSPRINT DD SYSOUT=*                                               
//SYSUDUMP DD SYSOUT=*                                               
//SYSOUT01 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)                       
//SYSOUT02 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSOUT03 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSOUT04 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSOUT05 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSOUT06 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSOUT07 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSOUT08 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSOUT09 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             
//SYSOUT10 DD UNIT=SYSDA,SPACE=(CYL,(5,1),RLSE)             

I thought it is some problem with memory and tried in program step to use a buffer card (which in reality does not help in any way!). And then I tried to use some extra space in my program step (by SYSOUT**-does not help again!). Guys any idea why I am getting this kind of problem? Pls help me guys!
Back to top
View user's profile Send private message
rajaherein

New User


Joined: 11 Jan 2007
Posts: 23
Location: chennai

PostPosted: Tue Nov 20, 2007 5:37 pm
Reply with quote

Check the File declaration and Working storage declaration, there might be some mismatch.
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Nov 20, 2007 5:39 pm
Reply with quote

Nop! I have already checked those things and they are fine at all.
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Tue Nov 20, 2007 6:26 pm
Reply with quote

can you run the program with that specific record and also post the sysout what you are getting?
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Nov 20, 2007 6:48 pm
Reply with quote

You seem to have a period (.) after your first GOTO in the AT END, which makes sense, as you cannot have two GOTO's in a row, or the compiler would have flagged that as either an error or dead code.

Therefore, your 2nd GOTO is not part of the condition AT END, and is therefore being taken after your first READ.
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Nov 20, 2007 7:35 pm
Reply with quote

Nop man! The problem was something else! I defined the copybook LBC005 in working storage obviously but if I declare it in the FILE SECTION after FD, it is working fine. Still don;t know the reason? Any further input pls!
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Nov 20, 2007 8:09 pm
Reply with quote

Amitava,

Post your copybook and also the position where you are getting junk data.

If possible post the junk data from the I/P records.
Back to top
View user's profile Send private message
Shanu.sukoor

New User


Joined: 31 Jan 2006
Posts: 32
Location: India

PostPosted: Thu Nov 22, 2007 12:33 pm
Reply with quote

Phrzby Phil wrote:
You seem to have a period (.) after your first GOTO in the AT END, which makes sense, as you cannot have two GOTO's in a row, or the compiler would have flagged that as either an error or dead code.

Therefore, your 2nd GOTO is not part of the condition AT END, and is therefore being taken after your first READ.


I think, After the first read it is executing second GO TO and not coming back. Please give some DISPLAY statements in 700-CONTROL-RPT and verify whether your code is executing till End Of File.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
Search our Forums:

Back to Top