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

Wat will be the relevant parameters for VSAM creation.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sanjay kumar tripathi

New User


Joined: 08 Jul 2008
Posts: 11
Location: chennai

PostPosted: Tue Jun 30, 2009 1:43 pm
Reply with quote

Hi all,

I have a requirement to create a vsam with average record length 127 and maximum of 381. The primary no. of records are 500000 and secondary 100000. I have created the VSam with following attributes.

DEFINE CLUSTER (NAME(vsam file) -
INDEXED -
NOREPLICATE -
RECORDS (500000,100000) -
RECORDSIZE (127,381) -
KEYS (25, 0) -
FREESPACE (10, 20) -
REUSE -
SHAREOPTIONS (4, 4)) -
DATA (NAME (vsamfile.DATA)) -
INDEX (NAME (vsamfile.INDEX))



But when i am running the program which uses this VSAM , after processing certain number of records(which is very less than 500000) its giving this error
COBOL: 24; VSAM:08, 0, 028

Could anyone please help me?
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 30, 2009 1:54 pm
Reply with quote

Please post the exact error messages and codes issued from the job output.

Also bear in mind
Quote:

When you define the cluster using the RECORDS parameter, the amount of free space specified is not considered in the calculations to determine primary allocation.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 30, 2009 2:03 pm
Reply with quote

Read VSAM Demystified

I would say that we should make this a sticky, but that would be a waste of time.

few search, few look at manuals, most just post the question and wait for answers.
Back to top
View user's profile Send private message
sanjay kumar tripathi

New User


Joined: 08 Jul 2008
Posts: 11
Location: chennai

PostPosted: Tue Jun 30, 2009 2:16 pm
Reply with quote

I have used following declarative in the program

DECLARATIVES.
ERR-FLAGFILE SECTION.
USE AFTER ERROR PROCEDURE NEWVSAM.

DISPLAY 'ERROR DURING PROCESSING VSAMFILE'.
DISPLAY 'COBOL: ' WS-ARCH-STAT
'; VSAM:' FLG1 ', ' FLG2 ', ' FLG3.
MOVE 8 TO RETURN-CODE.
STOP RUN.
END DECLARATIVES.

Therefore i am getting following error message -

ERROR DURING PROCESSING VSAMFILE
COBOL: 24; VSAM:08, 0, 028
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 30, 2009 2:24 pm
Reply with quote

OK, let's get to the basics.

Were there any IDC or IEC messages issued by the failing program.

You have defined the cluster, and what next -
Did you load it with data by some method
Do you use the program to load the data
How many records have been processed.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jun 30, 2009 3:09 pm
Reply with quote

Post a LISTCAT in BBcode format for the file so we can see the definition.

Also, how many records got loaded?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jun 30, 2009 3:14 pm
Reply with quote

expat: wanna bet the program is loading the file and the COBOL code writes the maximum record length instead of the actual record length, and that the record count loaded is therefore about 167,000? icon_cool.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jun 30, 2009 3:15 pm
Reply with quote

How to use bbcode
Back to top
View user's profile Send private message
sanjay kumar tripathi

New User


Joined: 08 Jul 2008
Posts: 11
Location: chennai

PostPosted: Tue Jun 30, 2009 3:37 pm
Reply with quote

I am not getting any other error mesage appart from that i mentioned. I have just created the VSAM with the specified attribute and then initialize it, because my program is using this in i/o mode. Thereafter my program is reading some values from databse and writing them into VSAM file.

Since VSAM is of variable record length, so i can not determine the exact reord being processed. In each and every run its used to be diferent.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 30, 2009 3:48 pm
Reply with quote

Mmmmmmm, setting up your own error messages when those that occur naturally from IBM are far more informative is not such a good idea. But then that's only my opinion.

Please post the LISTCAT requested by Robert.

Quote:
expat: wanna bet the program is loading the file and the COBOL code writes the maximum record length instead of the actual record length, and that the record count loaded is therefore about 167,000?

Robert: Bet against a sysprog ? NO WAY - they're shadier than an English summer

One thing that I have noticed is that when people load a cluster via a program rather than IDCAMS, they tend to be extremely lazy by not sorting the input file into key sequence order. Not only does this tend to take longer in total than a load from a sorted file + the sort time taken, it is also a recipe for more splits than you find at a schitzos comference.

Recall once this happened and during the load the job blew out after about 40 minutes. Irate developer screaming "You told me how much space to allocate - you got it wrong, you don't know what your on about ..... blah blah blah". I took a look at the file and it was split to pieces. I sorted the input and then reran, the job took about 25 minutes and the file was pristine on completion well within the space estimate that I'd given him. Sending him an email to explain the situation was a joy icon_lol.gif

Maybe this is the case here too
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jun 30, 2009 4:48 pm
Reply with quote

expat: Splits or every record written at maximum record length (or even both) -- the LISTCAT output will tell us. Presuming the COBOL file status is 24 per the message, the problem seems likely to be one of the two.

And sysprogs being shadier than an English summer? I doubt it. Maybe shadier than Seattle in the winter but not an English summer! icon_smile.gif

sanjay: you need to give us something more than you have -- such as the LISTCAT output. How many records are being processed before the problem occurs (approximately -- we understand how the count can vary a bit from run to run)? Is your input file sorted in the same sequence as the VSAM file key? And why are you using shareoptions of (4,4) -- unless you have specific requirements for (4,4) you are much better off using the more standard (2,3)? This could be the proximate cause of the error you're getting if the file is DISP=SHR; you cannot add space to a (4,4) VSAM file unless you have DISP=OLD specified.
Back to top
View user's profile Send private message
sanjay kumar tripathi

New User


Joined: 08 Jul 2008
Posts: 11
Location: chennai

PostPosted: Tue Jun 30, 2009 6:29 pm
Reply with quote

Thanks robert for the help.
I changed the disp mode to OLD and now its working fine.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 30, 2009 6:47 pm
Reply with quote

Good shot Rob, I never knew that. Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Jun 30, 2009 7:02 pm
Reply with quote

Thanks, expat -- I've run into that a time or two over the years. DISP=SHR and SHR(4,4) won't let you extend the VSAM file, even if there is secondary specified.

I still think there are other issues, but as long as the o/p is satisfied ...
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 30, 2009 7:20 pm
Reply with quote

Quote:
but as long as the o/p is satisfied ...

He will settle the invoice icon_biggrin.gif
Back to top
View user's profile Send private message
sanjay kumar tripathi

New User


Joined: 08 Jul 2008
Posts: 11
Location: chennai

PostPosted: Wed Jul 01, 2009 6:06 pm
Reply with quote

You are right robert, now i am facing one new issue.
Even VSAM is getting populated with the records perfectly, now its not in sorted order.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Wed Jul 01, 2009 6:19 pm
Reply with quote

Records in a VSAM KSDS have to be in ascending key sequence. If what you're seeing is not sorted in the order you expect, then you have specified the key position incorrectly.

GArry.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jul 01, 2009 6:25 pm
Reply with quote

What do you define as "sorted order"? The file will be kept in key sequence, no matter how you sorted it for input. The key sequence is the first 25 bytes of the record according to your first post. What sequence do you expect the records to be in?
Back to top
View user's profile Send private message
sanjay kumar tripathi

New User


Joined: 08 Jul 2008
Posts: 11
Location: chennai

PostPosted: Wed Jul 01, 2009 6:30 pm
Reply with quote

For example, records are getting stored like this:-

GB1X605 09070111006006099999999990
GB1X605 09070111006006199999999990
MT0353DMLA090701010010000MT0353DMLA
MT0353DMLA090701020010000ADDRESS
MT8000LMLA090701020040000NAME
MT8000LMLA090701060010000
MT8000LMLA090701070010000
SA0015ARUH090701010010000SA0015ARUHI
SA0015ARUH090701020010000ADDRESS

But it shuld come in sequence of M,G and S
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jul 01, 2009 6:42 pm
Reply with quote

Then your VSAM file definition is wrong. What is the actual key starting position and length supposed to be?

Assuming these are the first bytes of the records, they are sequenced as you specified in your first post -- G comes before M comes before S in the English alphabet, and that is how they are stored in the file. Further, MT0353 comes before MT8000 so these records are also sequenced as you specified in your original post.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Jul 01, 2009 8:55 pm
Reply with quote

Hello,

Quote:
But it shuld come in sequence of M,G and S
That may be some logical ordering, but it is not a collating sequence.

The system only works on the collating sequence (ebcdic for the mainframe) so the keys are in the proper order. Might not be what you want, but unless you change the record definition to include a prefix that will force the order you want, this is the order the sort will sequence the data and the order they will appear when inserted in a vsam ksds.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Starting a PROC with parameters from ... CLIST & REXX 6
No new posts VSAM LISTCAT INFORMATION JCL & VSAM 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
Search our Forums:

Back to Top