View previous topic :: View next topic
|
Author |
Message |
ursvmg
New User
Joined: 24 May 2007 Posts: 52 Location: Chennai
|
|
|
|
Hi,
I have 2 questions reg VSAM.....
1. Is it possible to download records from a VSAM file to a text file in anyway?
2. Is it possible to compare two records of a VSAM file?
Help me in this regard.......
Please correct me if I'm wrong |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
The short answer is:
Yes
&
Yes....
But that is not quite the answer you are looking for....
Interview? Requirement? What is the conditions surounding these questions? |
|
Back to top |
|
|
ursvmg
New User
Joined: 24 May 2007 Posts: 52 Location: Chennai
|
|
|
|
Thanks William,
Definitely it is both for requirement and learning. I know it is easy to download records from seq or pds. But i wanted to do for VSAM records.....
I would be thankful if you gimme the possible ways of achieving the task..... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
IDCAMS export....
IDCAMS repro....
Assembler....
COBOL....
SORT (either)....
Dang, any other other script or programming language....
Again,
Quote: |
Interview? Requirement? What is the conditions surounding these questions? |
|
|
Back to top |
|
|
ursvmg
New User
Joined: 24 May 2007 Posts: 52 Location: Chennai
|
|
|
|
Hi,
I have a VSAM file which contains more than 10000 records.... I wanted to compare the every fields of say 10th and 2000th record. it is not possible to check simultaneously. If it is possible to export those two records alone in to a text file, it would be easier to compare them. Also i want to print certain records, for that i would need it in a text file.
This is the actual reason and i'm not hiding anything.
Both the questions are asked for the same reason. But if both the ways are possible, then i could learn something.....
Thank You, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Is there some particular "key" value in those records or do you just happen to know that you want the 10th and 2000th records?
Which sort product does your organization use? If you have DFSORT and only 10000 records, you could run pass the vsam file 2 times creating a singe-record file each time for comparison. For normal use i'd not make 2 passes but for what you want, the expense will not be significant. Look at the DSFORT forum for examples of copying only a certain record from a larger group. I believe the parms you want are SKIPREC and STOPAFT (or something quite similar. The DFSORT manuals are available vial the "Manuals" link at the top of the web page.
Once you have created the 2 single-record files, you can compare them in tso/ispf (superc). |
|
Back to top |
|
|
ursvmg
New User
Joined: 24 May 2007 Posts: 52 Location: Chennai
|
|
|
|
Yes, My VSAM is having keys values. I just said the number for example. Actually i have to select two recs with the key values. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Then, if i understand more now, there really is no need for a text file.
If you know 2 keys, you could write a small program to read each and then compare the fields you want. |
|
Back to top |
|
|
ursvmg
New User
Joined: 24 May 2007 Posts: 52 Location: Chennai
|
|
|
|
Thanks dick,
Can you please gimme a sample piece of code to do that? Also tell me how to download a record to a text file for a particular key..... Give sample code for that too......
Thanks in advance, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you want to pull the records out of the VSAM file look at this from earlier
Quote: |
If you have DFSORT and only 10000 records, you could run pass the vsam file 2 times creating a singe-record file each time for comparison. For normal use i'd not make 2 passes but for what you want, the expense will not be significant. Look at the DSFORT forum for examples of copying only a certain record from a larger group. I believe the parms you want are SKIPREC and STOPAFT (or something quite similar. The DFSORT manuals are available vial the "Manuals" link at the top of the web page. |
If you want to use COBOL, there are examples in the documentation available from the "Manuals" link at the top of these web pages.
When you have something to compile/run, regardless of which approach you choose, we will be here to help with questions/problems. |
|
Back to top |
|
|
|