Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Partial key comaprison

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Partial key comaprison
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Fri Apr 28, 2006 6:20 pm    Post subject: Re: Partial key comaprison
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Read VSAM file based on a partial key seahawk789 JCL & VSAM 6 Tue Aug 19, 2014 10:26 am
No new posts Partial Distinct and converting rows ... Rajesh Haridoss DB2 10 Sat Jul 26, 2014 5:22 pm
No new posts Partial dataset name Processing in JCL l_rajendrakumar JCL & VSAM 2 Mon Jun 23, 2014 2:52 pm
No new posts TSO Find is not working on partial st... karthik_sripal TSO/ISPF 8 Tue May 14, 2013 1:51 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us