View previous topic :: View next topic |
Author |
Message |
adarsh444 Beginner
Joined: 19 Sep 2006 Posts: 13 Topics: 9
|
Posted: Sat Mar 10, 2007 1:12 pm Post subject: Validation on data entered on map |
|
|
I have to validate Customer and the code ranges entered by user on the map defined as an array.
WS-CUST-NAME(X(30)) occurs 20 times.
WS-FROM-CODE(X(04)) occurs 20 times.
WS-FROM-CODE(X(04)) occurs 20 times
Ex:Custname Fromcode - Tocode
HOLSON 0001 1000
Need to find the duplicates entered on map
a) No Duplicate customer and code are allowed.
i.e. If HOLSON 0010 - 0050 is entered on map elsewhere it should throw message 'Dup not allowed'. it would be gr8 if anyone can help me
in handling this logic. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Mar 12, 2007 3:29 am Post subject: |
|
|
What is wrong with:
Code: |
do i = 1 to 19
do j = 2 to 20
if var(i) = var(j) then errormsg
next j
next i
|
|
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Mon Mar 12, 2007 2:55 pm Post subject: |
|
|
do j=i+1 to 20 - otherwise it will always fail when i=j |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Mar 13, 2007 3:51 am Post subject: |
|
|
oh so true!  _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
|
|