View previous topic :: View next topic
|
Author |
Message |
Babu V P
New User
Joined: 27 Aug 2007 Posts: 6 Location: Chennai
|
|
|
|
Hi,
Need your valuable suggestions (if there is code then its fine for me;)) for the below.
Here is my requirement:
**I have 60 versions under a GDG base**
1. compare all the versions of a GDG for a certain column, like compare column 43 to 52 having DATE. DATE format is YYYY-MM-DD.
2. DATE field in all the versions must be different. That is, there should not be same date in more than one versions in column 43 to 52
3. If there is any duplicate versions having the entry in column 43 to 52 same, then that version must be captured and renamed with .DUP and then proceed further
4. DATE fields are same within a Version and should be different from other versions.
Let me know if the requirement is not clear.
Thanks,
Babu |
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
Please post an example of the input file and the expected o/p file |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
And also use the correct terminolgy - They are GENERATIONS not VERSIONS.
Generations and versions are completely seperate items with their own meaning. Please be accurate. |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
Babu,
If I have understood your requirement.............
Does a single generation contain a single date under that column for all records?? I mean, can diff records have diff dates under the column in question ?? IF NOT then,
Extract the date in question from GDG generation to a flat file as a single record. So flat file will have N records for N generations. eg. your flat file will look like this.
Code: |
2008-07-20 -- captured from 1st generation
2008-07-21 -- captured from 2nd generation
2008-07-22 -- captured from 3rd generation
|
Then check this file for duplicate records using sort.
--Parag |
|
Back to top |
|
|
Babu V P
New User
Joined: 27 Aug 2007 Posts: 6 Location: Chennai
|
|
|
|
Hi parag,
I can able to get these details into a PS file. But what i wanted is to get those two Versions which has same date and have to rename one of them:( |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
ok......
and what do you want this to be done using ?
COBOL, JCL REXX, anything else ?? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
do all the records in a particular version have the same date?
( to understand if, to check, is enough just to read one record )
is it a recurring task, or run once and hope that the error does not happen again ?
Rexx might be the fastest
listcat the gdg base
give input to a rexx script in a loop to
allocate a generation
read one record
build an output record with for example date and datasetname
sort to get the duplicates
build a jcl to do the rename ( sort itself or a rexx script )
beware that renaming a gdg generation migh mess up the whole thing,
better to check carefully every situation |
|
Back to top |
|
|
rakesha.hg
Active User
Joined: 21 Mar 2008 Posts: 161 Location: bangalore
|
|
|
|
please check this link might be useful
if not ignore it ! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
In addition to Enrico's comments, and my own understanding of the request ........
1) Use the GDG base t get the list of generations
DO LOOP
a) Allocate one generation
b) Sort on dates using SUM FIELDS=NONE
c) If SORTOUT count > 1 then flag as error
END DO LOOP
Would probably do a copy rather than a rename, as stated a rename might screw things up |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Babu,
Quote: |
get those two Versions which has same date and have to rename one of them |
If 3 generations are having the same date, what would you want to do? Keep the first and rename the other two?
Also if you have already implemented this, can you please post here the approach you have followed.
Thanks,
Arun |
|
Back to top |
|
|
|