View previous topic :: View next topic
|
Author |
Message |
richardmf
New User
Joined: 06 Apr 2006 Posts: 3
|
|
|
|
Hi,
I have requirement to compare only a part of the key with the working storage variable
ie. There's one VSAM file whose key length is 40 bytes.
Each time I read a record, I move the key to a working storage
variable. When I next read the file , I have to compare few fields of
the key with the same fields that had been stored in the working
storage variable before.I want to avoid individual field comparisons
for this. So is partial comparison is possible ?
eg. the key length is 40 bytes but I need to compare only first 25
bytes of the key ..
ie. IF key(1:25) = work-key(1:25) ??
if so can plz please guide me in that and if possible give some reference links for the same.
Thanks in advance..
Richard |
|
Back to top |
|
|
sri.mainframes
New User
Joined: 16 Feb 2006 Posts: 29 Location: MUMBAI
|
|
|
|
Hi richard
after comparing wat u further want to do , where u r storing in working storage section, in an array or a data name.
better to take an array WORK-KEY (I)
u can compare directly as u mentioned
MOVE WORK-KEY (I) TO work-key
IF key(1:25) = work-key(1:25)
ACTION statements
END-IF.
i think this will claer u , if not come back
thanks & regards
SRI.PRINCE |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Richard,
If you meant comparing a part of a variable to other, what you have written above, will work....
Code: |
IF key(1:25) = work-key(1:25) |
Did you face any prob in that ???
Regards,
Priyesh. |
|
Back to top |
|
|
|