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

Partial key comaprison


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

New User


Joined: 06 Apr 2006
Posts: 3

PostPosted: Fri Apr 28, 2006 10:21 am
Reply with quote

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
View user's profile Send private message
sri.mainframes

New User


Joined: 16 Feb 2006
Posts: 29
Location: MUMBAI

PostPosted: Fri Apr 28, 2006 1:02 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


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

PostPosted: Fri Apr 28, 2006 6:20 pm
Reply with quote

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
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 Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
No new posts EIBRESP=16 and EIBRESP2=25 while doi... CICS 2
No new posts Partial color change of a field in CI... CICS 5
No new posts Read VSAM file based on a partial key JCL & VSAM 6
No new posts Partial Distinct and converting rows ... DB2 10
Search our Forums:

Back to Top