View previous topic :: View next topic
|
Author |
Message |
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi madhu,
Would u please tell me what is the picture clause for key fields? |
|
Back to top |
|
|
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
Pic x(15)
Thanks
Madhu |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
Ok
I will check it out and let you know
thank you very much.
Madhu |
|
Back to top |
|
|
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
Hi,
Its not working , Can you tell me someother solution.
Thanks in advance
Madhu |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
It should work would u paste ur code |
|
Back to top |
|
|
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
Madhu Reddy
New User
Joined: 28 Sep 2006 Posts: 56
|
|
|
|
Can you suggest me solution how to handle this.
Thanks in advance
Madhu |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Madhu,
Please paste the variable defination as well code |
|
Back to top |
|
|
|