View previous topic :: View next topic
|
Author |
Message |
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
hi,
i have 2 input files.file1 has start date and end date.
file two has set of records.
say for example:
file1=LRECL=20
Code: |
2013-01-012013-12-12 |
FILE 2=(LRECL=15)
Code: |
2013-01-01ABCD
2013-02-01ABCD
2013-03-01ABCD
2013-04-01ABCD
2013-05-01ABCD
2013-06-01ABCD
2013-07-01ABCD
2013-08-01ABCD
2013-09-01ABCD
2013-10-01ABCD
2013-11-01ABCD
2013-12-01ABCD
2014-01-01ABCD |
AND I want to extract only those records which falls between the range of file1 dates.
i,e greater than 2013-01-01 and less than 2013-12-12
so my output should be
Code: |
2013-02-01ABCD
2013-03-01ABCD
2013-04-01ABCD
2013-05-01ABCD
2013-06-01ABCD
2013-07-01ABCD
2013-08-01ABCD
2013-09-01ABCD
2013-10-01ABCD
2013-11-01ABCD
2013-12-01ABCD |
i know this can be achieved using join keys. but is there any way we can build dynamic sort card and extract records from file2??
regds,
prahlad shetty |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Another way to do thi would be to read file 1 and assign symnames to the 2 dates.
Then copy/sort the file including or excluding the wanted or unwanted records. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
As Dick suggests if your version of DFSORT supprts SYMNAMES you can create SYMNAMES data dynamically and then sort
Lots of examples available on SYMNAMES |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I don't think symbols/SYMNAMES are very new. I doubt that anyone still has a DFSORT which does not have symbols/SYMNAMES. If they do, it is well, well, well, out of Support. |
|
Back to top |
|
|
|