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
 

 

Solution for the COBOL program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 5:37 pm    Post subject: Solution for the COBOL program
Reply with quote

Hi,

I have 6 input files , among this the first one is master file,
in the program it takes the key from the master file and compares in the
remaining 5 files whether this key is there or not,
If it exit it will be written to report file.

This program is not working properly by functionality so i debugged the
program and identified the cause.

The cause is

if the key in the master file and the key in the other files are of same length then it is working correctly
if the length is different it is not working correctly.
actually the key length in all the files is same,

for Example If the Key from Master file is 1234567(7 digits)
and key in other files is 3456789(7 digits)
It is working correctly

If the key in the master file is 1234567891(10 digits)
and the key in the other files is 456789564(9 digits)
the program is not working properly.

Could any one suggest the solution as early as possible.

Thanks in Advance.
Madhu
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 5:42 pm    Post subject:
Reply with quote

Hi Madhu,

I am not able to understand the fuctionality of ur program
& one point of time u r saying


actually the key length in all the files is same,

& then u say If the key in the master file is 1234567891(10 digits)
and the key in the other files is 456789564(9 digits)
the program is not working properly.

what do u mean by that.?
Please expain
Back to top
View user's profile Send private message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 6:10 pm    Post subject: Hi Ekta
Reply with quote

Hi,

05 B-CUSTID-EOF-KEY > 026460858
----+----1----+-
05 KSK-EOF-KEY > 0106927736
----------------------------------------------------------


IF B-CUSTID-EOF-KEY < KSK-EOF-KEY
MOVE B-CUSTID-EOF-KEY TO KSK-EOF-KEY.

In the above 05 levels are the values
If we see the If condition the value of B-CUSTID-EOF-KEY is less than KSK-EOF-KEY
then the value of B-CUSTID-EOF-KEY should be moved to KSK-EOF-KEY
but this is not happening .


05 B-CUSTID-EOF-KEY > 0026460858
----+----1----+-
05 KSK-EOF-KEY > 0106927736


IF B-CUSTID-EOF-KEY < KSK-EOF-KEY
MOVE B-CUSTID-EOF-KEY TO KSK-EOF-KEY.

In this case it is working properly.

Please let me know if have understood the problem, if not

Please let me know.

Thanks in advance
Madhu Sudhan Reddy
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 6:18 pm    Post subject:
Reply with quote

Hi madhu,

Would u please tell me what is the picture clause for key fields?
Back to top
View user's profile Send private message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 6:26 pm    Post subject: Hi
Reply with quote

Pic x(15)

Thanks
Madhu
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 6:33 pm    Post subject:
Reply with quote

Thats why its giving problem.
Berfor comparing move it working storage which is declared as 9(15) then compare it will work smoothly
Back to top
View user's profile Send private message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 6:41 pm    Post subject: Hi
Reply with quote

hi,

We are moving it to the working storage variable

MOVE A-MGBUSCONTNR-EOF-KEY TO KSK-EOF-KEY.
IF B-CUSTID-EOF-KEY < KSK-EOF-KEY
MOVE B-CUSTID-EOF-KEY TO KSK-EOF-KEY.

Please let me know if you need more informations
thanks
Madhu
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 6:45 pm    Post subject:
Reply with quote

You did not got my point i am saying that rather comparing field which is declare as X(15) compared the field which is decalre as 9(15) so that they can compare numeric variable.
Back to top
View user's profile Send private message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 7:03 pm    Post subject: Hi
Reply with quote

Ok

I will check it out and let you know

thank you very much.

Madhu
Back to top
View user's profile Send private message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 7:41 pm    Post subject: Hi
Reply with quote

Hi,

Its not working , Can you tell me someother solution.

Thanks in advance
Madhu
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 8:17 pm    Post subject:
Reply with quote

It should work would u paste ur code
Back to top
View user's profile Send private message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Mon Oct 09, 2006 5:14 pm    Post subject: The Code
Reply with quote

MOVE A-MGBUSCONTNR-EOF-KEY TO KSK-EOF-KEY.
IF B-CUSTID-EOF-KEY < KSK-EOF-KEY
MOVE B-CUSTID-EOF-KEY TO KSK-EOF-KEY.
IF C-CUSTID-EOF-KEY < KSK-EOF-KEY
MOVE C-CUSTID-EOF-KEY TO KSK-EOF-KEY.
IF D-CUSTID-EOF-KEY < KSK-EOF-KEY
MOVE D-CUSTID-EOF-KEY TO KSK-EOF-KEY.
IF E-CUSTID-EOF-KEY < KSK-EOF-KEY
MOVE E-CUSTID-EOF-KEY TO KSK-EOF-KEY.
IF F-CUSTID-EOF-KEY < KSK-EOF-KEY
MOVE F-CUSTID-EOF-KEY TO KSK-EOF-KEY.
.

Do you want the whoel Code.
Please let me Know

Thanks
Madhu
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Sun Oct 15, 2006 9:10 am    Post subject: Re: Could any one suggest the solution for the COBOL program
Reply with quote

Madhu... The only reason for this problem seems that you are playing with numbers but the field definition is alphanumeric, which is causing an alignment problem for your fields.

05 B-CUSTID-EOF-KEY > 026460858
----+----1----+-
05 KSK-EOF-KEY > 0106927736

Here I suspect there should be another character after "026460858" as its 9 bit only and KSK-EOF-KEY is a 10 digit value.
Back to top
View user's profile Send private message
Madhu Reddy
Currently Banned

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Mon Oct 16, 2006 2:35 pm    Post subject:
Reply with quote

Can you suggest me solution how to handle this.

Thanks in advance

Madhu
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Mon Oct 16, 2006 3:11 pm    Post subject:
Reply with quote

Hi Madhu,

Please paste the variable defination as well code
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 SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am


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