Dates comparision between two dates problem

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
b_boby
Participant
Posts: 2
Joined: Tue Feb 15, 2005 7:14 am

Dates comparision between two dates problem

Post by b_boby »

Guys,
How to compare date1( non key) from file1 to check in Between two dates i.e date2A and date2B ( both non keys) on file2. There is no common key between these two files to use hash file(server) or look up(PX). I can move this data to DB and use join there I completely lost performance and don't have space on system. Can you halp me in this? Thanks for your help.

Bobby Smith
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

There are 2 methods
1.) create an hash-file with all individual date values between the date range and define it to be the key. Thus if you want to lookup an inbetween date, it will be in the hash-file.
2.) Use a cross product (outer) join of both files with some dummy key and use the constraint of file1.datevalue >= file2.startdate and file1.datevalue <= file2.enddate.

Obviously the resource constraint will apply in these cases.

Alternatively you can code your own BASIC language program to scan through the entire file (file2) for each record in source file (file1).
Post Reply