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

To download records from VSAM


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

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Tue Jun 26, 2007 2:05 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jun 26, 2007 2:50 am
Reply with quote

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
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Tue Jun 26, 2007 2:58 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jun 26, 2007 3:24 am
Reply with quote

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
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Tue Jun 26, 2007 3:35 am
Reply with quote

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. icon_sad.gif

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jun 26, 2007 3:48 am
Reply with quote

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
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Tue Jun 26, 2007 3:52 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jun 26, 2007 7:33 am
Reply with quote

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
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Wed Jun 27, 2007 1:05 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jun 27, 2007 1:29 am
Reply with quote

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
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top