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

Generic Vsam file key in EZT


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aman jain

New User


Joined: 13 Jan 2008
Posts: 4
Location: Noida

PostPosted: Mon Apr 27, 2009 2:29 pm
Reply with quote

Hi, I have a VSAM file having key length of 16 bytes of which last 6 bytes are not requried. How can I use its 10 bytes as keys in program to read or fetch its records from the file to use in the program main procedure.

READ FILE1 KEY WS-FILE1-KEY STATUS

can WS-FILE1-KEY this be of 10 length so that it can read the records in the file matching for only first 10 bytes.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Apr 27, 2009 2:49 pm
Reply with quote

Please post your question in the correct forum.
Back to top
View user's profile Send private message
aman jain

New User


Joined: 13 Jan 2008
Posts: 4
Location: Noida

PostPosted: Mon Apr 27, 2009 3:49 pm
Reply with quote

I mean if a VSAM file is defined of keylength 16 initially then is there any method to use only it's first 10 bytes to find and read its records in Eazytrieve coding.

Code:
WS-PSINV-KEY                        W                       16    A       
WS-BRANCH-NO-3BYTES          WS-PSINV-KEY     3     P 0
WS-BRANCH-SUFFIX                WS-PSINV-KEY   +3  1 A 
WS-FOLIO-SERIES-IDENTIFIER WS-PSINV-KEY   +4  1 A 
WS-FOLIO-YEAR                      WS-PSINV-KEY   +5  2 P 0
WS-FOLIO-MONTH                   WS-PSINV-KEY   +7  2 P 0
WS-FOLIO-NUMBER                 WS-PSINV-KEY   +9  3 P 0
WS-FILLER                             WS-PSINV-KEY   +12 4 A


IN CODE :

READ FILE1 KEY WS-FILE1-KEY STATUS

Can WS-FILE1-KEY this be of 12 bytes skipping the last 4 bytes spaces.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Mon Apr 27, 2009 5:30 pm
Reply with quote

If you were using CICS, there's a KEYLENGTH () GENERIC capability.

In batch, you can use START KEY GE <var> where <var> is your 10 bytes of the key. The COBOL Language Reference manual says
Quote:
The file position indicator points to the first record in the file whose key field satisfies the comparison. If the operands in the comparison are of unequal lengths, the comparison proceeds as if the longer field were truncated on the right to the length of the shorter field. All other numeric and alphanumeric comparison rules apply, except that the PROGRAM COLLATING SEQUENCE clause, if specified, has no effect.
After the START, and assuming it is successful, you can use READ NEXT to get the record.
Back to top
View user's profile Send private message
aman jain

New User


Joined: 13 Jan 2008
Posts: 4
Location: Noida

PostPosted: Mon Apr 27, 2009 5:46 pm
Reply with quote

Thanks for the prompt response!
Actually I am coding in Eazytrieve and not using CICS.

START KEY GE <var> is being used in COBOL so same can be used in
eazytrive as well.
Please reply!!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Mon Apr 27, 2009 6:06 pm
Reply with quote

I don't use Easytrieve so I have no idea.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Apr 27, 2009 7:16 pm
Reply with quote

You may need to use POINT:
Code:
                {= }
                {EQ} {          }
POINT file-name {GE} {field-name} [STATUS]
                {GQ} {literal   }
                {>=}

since it appears that READ doesn't allow generic keys:
Code:
                   {          }
READ file-name KEY {field-name} [STATUS]
                   {'literal' }
Back to top
View user's profile Send private message
aman jain

New User


Joined: 13 Jan 2008
Posts: 4
Location: Noida

PostPosted: Tue Apr 28, 2009 5:29 pm
Reply with quote

Thank You all!!
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top