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
 

 

Problem in input read...

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Problem in input read...
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    Post subject:
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    Post subject:
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: Chennai

PostPosted: Tue Nov 20, 2007 6:26 pm    Post subject: Reply to: Problem in input read...
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

Active Member


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

PostPosted: Tue Nov 20, 2007 6:48 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Tue Nov 20, 2007 8:09 pm    Post subject:
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    Post subject:
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    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
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 4 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Formating the Input file sreekusr DFSORT/ICETOOL 3 Fri Feb 17, 2017 10:40 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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