View previous topic :: View next topic
|
Author |
Message |
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
Guys
I need an urgent bit of help!
We have a VB sequential file on TAPE. The definition is as given below:
UNIT=VTAPE,
DCB=(BCSPN.MODEL,RECFM=VB,LRECL=940,BUFNO=40)
Question A:
I need to convert this to a VSAM file (for keyed reading) but keep the lengths/blocks intact. How do I do this? (will a normal IDCAMS do?)
Question B:
Once we have the VSAM, we need to read it and write the selected records in an output of the original sequential format. (RECFM=VB,LRECL=940). Is this possible? We are using normal COBOL370.
Help someone! |
|
Back to top |
|
|
Ramya A
Active User
Joined: 26 Jul 2004 Posts: 104
|
|
|
|
Hi VG
I believe both the above tasks are possible with IDCAMS.
A) Define a new VSAM file with the length and blocks of your seq file using a IDCAMS step. The use another IDCAMS step to copy your seq file to the VSAM.
B) A DFSORT should be able to copy your selected records to seq file.
Correct me if I'm wrong.
Rgds,
Ramya |
|
Back to top |
|
|
naive
New User
Joined: 26 Apr 2005 Posts: 46 Location: LA
|
|
|
|
hey ramya!
thanx for the reply but i need something more specific!
the seq file I have has a max record length of 940. But the length varies depending on the data in each row.
How do I get the average Rec L required to allocate the VSAM?
If i remember correctly, you need to give
a)Max Recl
b) Avg Recl
to specify the KSDS VSAM rite?
Is there any way I could allocate the VSAM without having to specify the avg length? If not, then what do i put in the avg length?
Or else, is there any way by which I can directly copy the seq to the variable length VSAM while maintaining each indiv rec l intact?? |
|
Back to top |
|
|
Ramya A
Active User
Joined: 26 Jul 2004 Posts: 104
|
|
|
|
Hi VG
I tried to find any calculations to be followed for finding the average lrecl. But found none.
As far as my knowledge goes, in the DEFINE cluster, use the RECORDSIZE parameter to specify if it is VB or FB.
RECORDSIZE(average lrecl, max lrecl)
If both average and max are equal ==> FB
Else, VB
average may be calculated as the average between the minimum recl possible in your file and the maximum lrecl. I believe the value in the average clause may not make a difference in the VSAM allocation.
If I'm wrong let me know.
Rgds,
Ramya |
|
Back to top |
|
|
|