Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Generic Vsam file key in EZT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Generic Vsam file key in EZT
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: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 27, 2009 2:49 pm    Post subject:
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    Post subject: Reply to: Vsam file key alteration
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: 7932
Location: Bellevue, IA

PostPosted: Mon Apr 27, 2009 5:30 pm    Post subject:
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    Post subject: Reply to: Vsam file key alteration
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: 7932
Location: Bellevue, IA

PostPosted: Mon Apr 27, 2009 6:06 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Mon Apr 27, 2009 7:16 pm    Post subject:
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    Post subject: Reply to: Generic Vsam file key in EZT
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us