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

Copy some records from Master VSAM file to Test VSAM file


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

New User


Joined: 14 Jan 2007
Posts: 33
Location: USA

PostPosted: Fri Feb 23, 2007 5:09 am
Reply with quote

I need copy some records from Master VSAM file to Test VSAM file based on Orig-date condition(Orig-date must be greater than or equal to 01-01-2007 (01-01-2007 is stored as 1070101 in the master file). Orig-date is declared as PIC S9(3) COMP-3.

For this I used the following method.

1. Defined TEST VSAM file using DEFINE CLUSTER

2. Copied the 30000 records from Master file using IDCAMS and REPRO into a Sequential file.

3. Used Sequential file as SORTIN file and sorted records based on condition into SORTOUT(TEST VSAM file). Used INCLUDE COND (1,11,PD,GE,10701).

Is there any other method to do the above procedure?. Please let me know.

Thanks,
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Feb 23, 2007 5:40 am
Reply with quote

Jeya Raj wrote:
(01-01-2007 is stored as 1070101 in the master file). Orig-date is declared as PIC S9(3) COMP-3.
Quote:
Used INCLUDE COND (1,11,PD,GE,10701)
If you are going to do the include cond against a comp-3 field, and declare it as such, you have to give it the full field, i.e., INCLUDE COND (1,11,PD,GE,1070101)
Give that a try and let us know, good or bad, how it turns out.
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: Fri Feb 23, 2007 5:50 am
Reply with quote

Hello,

The digits 1070101 will not fit into a field that is PIC S9(3) comp-3 icon_confused.gif
Back to top
View user's profile Send private message
Jeya Raj

New User


Joined: 14 Jan 2007
Posts: 33
Location: USA

PostPosted: Fri Feb 23, 2007 6:30 am
Reply with quote

I actually created the TEST file based on the condition and checked at the data in that file, it looked good. My question is, is there any other way to copy the VS AM file with condition?. Instead of using the sequential file, is there any way to copy from master file using that condition?. Any CL utilities available to copy vsam to vsam based on condition.

Thanks,
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Feb 23, 2007 6:30 am
Reply with quote

good point, I didn't think of that....My ex-wife would refer to it as "male vision".... icon_redface.gif
I must have been suckered in by the 1,11,PD..... icon_smile.gif
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: Fri Feb 23, 2007 9:23 am
Reply with quote

Hello,

You could read the vsam file with Easytrieve or a little COBOL program and either create a flat file to load or write the new records into a new vsam file.

Does your site use DFSORT or Syncsort?

I seem to recall that with both sorts you can process vsam in and back out to a new vsam file. The DFSORT manual shows an example of vsam in and vsam out in a sort. I may be mistaken about Syncsort as i have no doc here for Syncsort. If you are interested and send a reply, i'll check tomorrow when i've all the doc available.
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top