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

Solution for the COBOL program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Madhu Reddy

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 5:37 pm
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: 1208
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 5:42 pm
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

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 6:10 pm
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: 1208
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 6:18 pm
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

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 6:26 pm
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: 1208
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 6:33 pm
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

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 6:41 pm
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: 1208
Location: Bangalore,India

PostPosted: Fri Oct 06, 2006 6:45 pm
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

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 7:03 pm
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

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Fri Oct 06, 2006 7:41 pm
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: 1208
Location: Bangalore,India

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

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

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Mon Oct 09, 2006 5:14 pm
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: 1448
Location: Chicago, IL

PostPosted: Sun Oct 15, 2006 9:10 am
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

New User


Joined: 28 Sep 2006
Posts: 56

PostPosted: Mon Oct 16, 2006 2:35 pm
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: 1208
Location: Bangalore,India

PostPosted: Mon Oct 16, 2006 3:11 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top