Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compare all version for a particular column

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Compare all version for a particular column
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    Post subject: Reply to: Compare all version for a particular column
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 23, 2008 5:01 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Compare all version for a particular column
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Wed Jul 23, 2008 7:18 pm    Post subject: Reply to: Compare all version for a particular column
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    Post subject: Reply to: Compare all version for a particular column
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 23, 2008 7:45 pm    Post subject:
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: 2284
Location: @my desk

PostPosted: Fri Jul 25, 2008 1:28 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts fuzzy compare Martylin JCL & VSAM 9 Thu Mar 30, 2017 2:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us