So i need to sort the INPUT file based on the key(NASCO-SUB-ID,NASCO-DEP-ID,SRC-SYS-KEY) to get the latest record with respect to the Timestamp.
The key which i have mentioned above forms the unique key for that input file. so i need to retrieve the latest record containing the highest timestamp from the input file for each unique key.
In the Input file, some of the records contains 'blanks' for the columns NASCO-SUB-ID,NASCO-DEP-ID respectively.
when i tried to sort using JCL, the records conatining blanks in the Key field are getting eliminated.
All the records contain SRC-SYS-KEY column in the input file.
when i tried to sort using JCL, the records conatining blanks in the Key field are getting eliminated.
Provide us the JCL which u had tried so that we can help u out where u were missing.
Quote:
All the records contain SRC-SYS-KEY column in the input file.
Also give a subset of the output record so that we can have a look at it. _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Mon Oct 15, 2007 1:09 pm Post subject:
This does not appear to be a JCL problem but a SORT problem so it should be posted in the Utilities section where SORT threads are. However, that said, there are a couple pf points:
as your keys, excluding Timestamp, are contiguous you can code one condition instead of 3
these same 3 keys are numeric (PIC 9) but you are sorting as character (CH) instead of numeric (ZD - zoned decimal)
SUM FIELDS=NONE will drop duplicate key records but I believe all the keys have to be duplicate so are you 100% sure that SRC-SYS-KEY is ALWAYS non-blank?
_________________ Utility and Program control cards are NOT, repeat NOT, JCL.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Oct 15, 2007 1:37 pm Post subject:
Quote:
when i tried to sort using JCL, the records conatining blanks in the Key field are getting eliminated.
waves,
It's not clear what you think the problem is.
Since you're using SUM FIELDS=NONE, all but one of the records containing blanks in the key field would be eliminated. That's what SUM FIELDS=NONE does.
What is it exactly you want for the output?
Sample input and output would be something like this:
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Last edited by Frank Yaeger on Tue Oct 16, 2007 11:26 am; edited 1 time in total
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Oct 16, 2007 11:25 am Post subject:
Quote:
please help me how to get the same output using SYNCSORT.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum