View previous topic :: View next topic
|
Author |
Message |
Direction
New User
Joined: 15 Sep 2005 Posts: 11
|
|
|
|
Hi all,
I had query in JCL. I want to fetch the data from input file and write to output file. Here is the test data.
ITEM TIMESTAMP
123 123456
122 123457
121 123459
121 123460
121 123461
Ouput will be:
123 123456
122 123457
121 123461
I have to get the unique value for Item, If there is multiple occurence for item like 121 than I have select the line with latest timestamp or with highest TIMESTAMP VALUE, ignoring the other values.
I want to do it through JCL, can u all help me out. |
|
Back to top |
|
|
sunish
New User
Joined: 23 May 2005 Posts: 19
|
|
|
|
hi
this is the jcl
//sysprint dd sysout=*
//sysin dd *
sort fields=(1,3,ch,a)
sumfields=none
/*
//
correct me if it is worng |
|
Back to top |
|
|
Direction
New User
Joined: 15 Sep 2005 Posts: 11
|
|
|
|
Thanx for ur favour, But it not giving the desired result.
By using this JCL my output is :
123 123456
122 123457
121 123459
But the Answer I reqire is:
123 123456
122 123457
121 123461 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
123 123456
122 123457
121 123459
121 123460
121 123461
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,3,CH) LAST USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,3,CH,D)
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|