IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL sort related


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mani453

New User


Joined: 19 Nov 2015
Posts: 13
Location: INDIA

PostPosted: Sun Dec 20, 2015 1:04 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Dec 20, 2015 4:36 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sun Dec 20, 2015 4:45 pm
Reply with quote

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
View user's profile Send private message
Mani453

New User


Joined: 19 Nov 2015
Posts: 13
Location: INDIA

PostPosted: Sun Dec 20, 2015 7:57 pm
Reply with quote

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
View user's profile Send private message
Mani453

New User


Joined: 19 Nov 2015
Posts: 13
Location: INDIA

PostPosted: Sun Dec 20, 2015 8:02 pm
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sun Dec 20, 2015 8:37 pm
Reply with quote

And what have you tried yourself?
Back to top
View user's profile Send private message
Mani453

New User


Joined: 19 Nov 2015
Posts: 13
Location: INDIA

PostPosted: Sun Dec 20, 2015 9:03 pm
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sun Dec 20, 2015 9:32 pm
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sun Dec 20, 2015 10:59 pm
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Sun Dec 20, 2015 11:27 pm
Reply with quote

Look at this: http://ibmmainframes.com/viewtopic.php?t=64604

.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Mon Dec 21, 2015 11:33 pm
Reply with quote

Where is timestamp though? icon_rolleyes.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Dec 22, 2015 3:34 am
Reply with quote

It is not a timestamp - it is a date. A timestamp includes date AND time.
Back to top
View user's profile Send private message
wiprov

New User


Joined: 13 Feb 2008
Posts: 15
Location: Chennai

PostPosted: Tue Dec 22, 2015 5:42 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Dec 22, 2015 9:31 pm
Reply with quote

wiprov, You have overlooked the link given by RahulG31. btw that should work.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top