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

Compare all version for a particular column


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

New User


Joined: 27 Aug 2007
Posts: 6
Location: Chennai

PostPosted: Wed Jul 23, 2008 4:22 pm
Reply with quote

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

Active User


Joined: 03 Aug 2005
Posts: 306

PostPosted: Wed Jul 23, 2008 4:27 pm
Reply with quote

Please post an example of the input file and the expected o/p file
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 23, 2008 5:01 pm
Reply with quote

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

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Wed Jul 23, 2008 5:11 pm
Reply with quote

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

New User


Joined: 27 Aug 2007
Posts: 6
Location: Chennai

PostPosted: Wed Jul 23, 2008 7:07 pm
Reply with quote

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

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Wed Jul 23, 2008 7:14 pm
Reply with quote

ok......
and what do you want this to be done using ?
COBOL, JCL REXX, anything else ??
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jul 23, 2008 7:18 pm
Reply with quote

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 ? icon_smile.gif

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

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Wed Jul 23, 2008 7:40 pm
Reply with quote

please check this link might be useful

if not ignore it !
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 23, 2008 7:45 pm
Reply with quote

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

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jul 25, 2008 1:28 pm
Reply with quote

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
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top