JCL sort related

Author Message
Mani453

New User

Joined: 19 Nov 2015
Posts: 13
Location: INDIA

 Posted: Sun Dec 20, 2015 1:04 pm 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
Bill Woodger

Moderator Emeritus

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

 Posted: Sun Dec 20, 2015 4:36 pm 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.
Nic Clouston

Global Moderator

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

 Posted: Sun Dec 20, 2015 4:45 pm Moved to correct part of form. If you wanted a sort solution why didn't you post there in the first place?
Mani453

New User

Joined: 19 Nov 2015
Posts: 13
Location: INDIA

 Posted: Sun Dec 20, 2015 7:57 pm 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.
Mani453

New User

Joined: 19 Nov 2015
Posts: 13
Location: INDIA

 Posted: Sun Dec 20, 2015 8:02 pm 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.
prino
Warnings : 1

Senior Member

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

 Posted: Sun Dec 20, 2015 8:37 pm And what have you tried yourself?
Mani453

New User

Joined: 19 Nov 2015
Posts: 13
Location: INDIA

 Posted: Sun Dec 20, 2015 9:03 pm Actually I have 6more requirements.. I have tried althose and got the result using JCL. For this scenario I m not getting thought.
prino
Warnings : 1

Senior Member

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

Posted: Sun Dec 20, 2015 9:32 pm

 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!
steve-myers

Active Member

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

 Posted: Sun Dec 20, 2015 10:59 pm 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.
RahulG31

Active User

Joined: 20 Dec 2014
Posts: 446
Location: USA

 Posted: Sun Dec 20, 2015 11:27 pm Look at this: http://ibmmainframes.com/viewtopic.php?t=64604 .
Rohit Umarjikar

Global Moderator

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

 Posted: Mon Dec 21, 2015 11:33 pm Where is timestamp though?
Nic Clouston

Global Moderator

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

 Posted: Tue Dec 22, 2015 3:34 am It is not a timestamp - it is a date. A timestamp includes date AND time.
wiprov

New User

Joined: 13 Feb 2008
Posts: 15
Location: Chennai

Posted: Tue Dec 22, 2015 5:42 pm

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)
Rohit Umarjikar

Global Moderator

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

 Posted: Tue Dec 22, 2015 9:31 pm wiprov, You have overlooked the link given by RahulG31. btw that should work.
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics Date conversion using SORT SYNCSORT 4 Which SORT utility can improve the Pe... DFSORT/ICETOOL 16 Using sort on VB records based on off... DFSORT/ICETOOL 6 COBOL VS SORT Utility for file format... COBOL Programming 6 Related to using a file in comparison JCL & VSAM 8
Search our Forums: