View previous topic :: View next topic
|
Author |
Message |
Mani453
New User
Joined: 19 Nov 2015 Posts: 13 Location: INDIA
|
|
|
|
Hi,
I have the input data as below. How can i get max of timestamp in the output file as below.
I need to compare with the first 7 fields from the row (2345^34).
Input:
2345^34 520 DFAKAJDEIH 2013-02-01
2345^34 520 DFAKAJDHSA 2013-02-04
2345^35 520 DFAKAJDHSA 2013-02-05
2345^36 520 DFAKAJDHSA 2013-02-06
Output
2345^34 520 DFAKAJDHSA 2013-02-04
2345^35 520 DFAKAJDHSA 2013-02-05
2345^36 520 DFAKAJDHSA 2013-02-06 |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
It's not really clear what you want, but I think OUTFIL reporting features will do what you want. REMOVECC, NODETAIL with SECTIONS (specifying the key) and MAX for your date-field. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Moved to correct part of form.
If you wanted a sort solution why didn't you post there in the first place? |
|
Back to top |
|
|
Mani453
New User
Joined: 19 Nov 2015 Posts: 13 Location: INDIA
|
|
|
|
Hi
Please observe my below input points and output needed
1. In my input first 7 characters are same in two rows but the time stamp is different.
2. Remaining two rows(i.e, 3&4) are different.
My requirement : I need a sort card for this scenario
1. If we observe the output, only three rows fetched because in the first 7 characters in (1&2) rows are same. It fetched based on the latest timestamp.
If my ques is not clear pls let me know. |
|
Back to top |
|
|
Mani453
New User
Joined: 19 Nov 2015 Posts: 13 Location: INDIA
|
|
|
|
JCL sort card I need to use
If the first 7 characters are equal then it should be pic the latest timestamp row for the output. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
And what have you tried yourself? |
|
Back to top |
|
|
Mani453
New User
Joined: 19 Nov 2015 Posts: 13 Location: INDIA
|
|
|
|
Actually I have 6more requirements.. I have tried althose and got the result using JCL. For this scenario I m not getting thought. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Mani453 wrote: |
I have tried althose and got the result using JCL. |
That is a blatant lie!
JCL tells z/OS what programs to execute and the datasets and what other resources are required by those programs.
There isn't a flucking JCL statement in existence that can do what you want! |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Mani453 - Prino is telling you that there is no such thing as a "JCL sort." JCL is just the control statements that direct the system to run a program, like the sort program, and specify the data sets the program is to use.
There are two common sort programs that are usually run by JCL: the DFSORT program from IBM, and Syncsort from another company. The two programs are similar, though by no means identical. Both programs are superb. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Where is timestamp though? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
It is not a timestamp - it is a date. A timestamp includes date AND time. |
|
Back to top |
|
|
wiprov
New User
Joined: 13 Feb 2008 Posts: 15 Location: Chennai
|
|
|
|
Mani,
Can you try this?
Code: |
//STEP01 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
2345^34 520 DFAKAJDEIH 2013-02-01
2345^34 520 DFAKAJDHSA 2013-02-04
2345^35 520 DFAKAJDHSA 2013-02-05
2345^36 520 DFAKAJDHSA 2013-02-06
//T1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) TO(T1) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,7,CH) FIRST
//CTL1CNTL DD *
SORT FIELDS=(1,7,CH,A,24,10,CH,D)
|
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
wiprov, You have overlooked the link given by RahulG31. btw that should work. |
|
Back to top |
|
|
|