View previous topic :: View next topic
|
Author |
Message |
Jeya Raj
New User
Joined: 14 Jan 2007 Posts: 33 Location: USA
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The digits 1070101 will not fit into a field that is PIC S9(3) comp-3 |
|
Back to top |
|
|
Jeya Raj
New User
Joined: 14 Jan 2007 Posts: 33 Location: USA
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
good point, I didn't think of that....My ex-wife would refer to it as "male vision"....
I must have been suckered in by the 1,11,PD..... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|