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

DFSORT Final output should not have duplicates of Column A


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

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Tue Oct 17, 2006 4:11 pm
Reply with quote

Hi all icon_smile.gif ,

I have a file with below format,
aaa 2 3
ddd 4 6
bbb 6 8
ccc 8 10
bbb 8 9
aaa 9 9
ccc 9 11
ddd 5 7

I need the following entries alone
aaa 9 9
bbb 8 9
ccc 9 11
ddd 5 7

i.e., Column A sorted by ascending order, Column B & C sorted by descending order. Final output should not have duplicates of Column A value. Please help me...

Regards,
Ramanan R
Back to top
View user's profile Send private message
sridevi2005

New User


Joined: 15 Sep 2005
Posts: 42

PostPosted: Tue Oct 17, 2006 4:31 pm
Reply with quote

Hi,

U can use the following code

In step1 use this sort SORT FIELDS=(1,3,CH,A,5,1,CH,D,7,2,CH,D)
In step2 use this sort
SORT FIELDS=(1,3,CH,A)
SUM FIELDS=NONE

Please check.

Thanks
Back to top
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Tue Oct 17, 2006 6:44 pm
Reply with quote

Hi Sreedevi icon_smile.gif,

Thanks for your response.

Is there anyway to execute in single step?

Regards,
Ramanan R
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Oct 17, 2006 8:34 pm
Reply with quote

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 *
aaa 2  3
ddd 4  6
bbb 6  8
ccc 8 10
bbb 8  9
aaa 9  9
ccc 9 11
ddd 5  7
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,3,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,3,CH,A,5,1,ZD,D,7,2,FS,D)
/*
Back to top
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Wed Oct 18, 2006 9:13 pm
Reply with quote

Dear Frank icon_smile.gif ,

Thanks for your reply. Can we use INCLUDE & INREC fields with ICETOOL as given below?

Code:
//USER2550 JOB (USERTT,ACCNT1),14SYS,CLASS=X,       
//         MSGCLASS=M,NOTIFY=&SYSUID                 
//**                                                 
//S1 EXEC PGM=ICETOOL                               
//TOOLMSG DD SYSOUT=*                               
//DFSMSG DD SYSOUT=*                                 
//IN     DD DSN=TEST01.USER01.SARBCH.REPORT,         
//       DISP=SHR                                   
//OUT    DD SYSOUT=*                                 
//TOOLIN DD *                                       
 SELECT FROM(IN) TO(OUT) ON(1,8,CH) FIRST USING(CTL1)
/*                                                   
//CTL1CNTL DD *                                     
 INCLUDE COND=(85,4,CH,EQ,C'DISK')                   
 INREC FIELDS=(35,8,53,5,59,5)                       
 SORT FIELDS=(1,8,CH,A,9,5,BI,D,14,5,BI,D)           
/*                                                   


The INDSN 'TEST01.USER01.SARBCH.REPORT' has below structure. The JOBNAME column starts at column # 35.

Code:

       Unicenter CA-View Output Archival and Viewing (11.0)             
        Batch Processing Utility - Sysout Archival Listing             
Jobname  Jobid      Gen   Seq  Arc Date  Arc Time Loc    Lines    Pages
-------- -------- ----- ----- ---------- -------- ---- -------- --------
PRDJOB1 J0820169  9159     1 10/17/2006 10:41:46 DISK     353        8
PRDJOB8 J0799458  9158     2 10/16/2006 10:27:32 DISK     353        8
PRDJOB2 J0780228  9157     4 10/15/2006 10:18:28 DISK     353        8
PRDJOB5 J0768189  9156     9 10/14/2006 10:49:35 DISK     353        8
PRDJOB2 J0754593  9155     7 10/13/2006 11:07:30 DISK     353        8
PRDJOB1 J0735327  9154     3 10/12/2006 11:17:24 DISK     353        8
PRDJOB3 J0713932  9153     2 10/11/2006 10:44:54 DISK     353        8
PRDJOB4 J0693949  9152     9 10/10/2006 10:54:03 TAPE     353        8
PRDJOB5 J0673953  9151     3 10/09/2006 10:32:55 TAPE     353        8
PRDJOB7 J0657043  9150     4 10/08/2006 10:32:20 TAPE     353        8
PRDJOB6 J0646025  9149     2 10/07/2006 10:41:52 TAPE     353        8
PRDJOB9 J0630082  9148     9 10/06/2006 10:51:47 TAPE     353        8
PRDJOB1 J0611892  9147     4 10/05/2006 10:48:02 TAPE     353        8


The requirement is to sort GEN & SEQ column in descending order and with no duplicates in JOBNAME column.

Thanks & Regards,
Ramanan R
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 18, 2006 10:14 pm
Reply with quote

That will work if you have z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). You need that PTF to use INREC with SELECT. If you see 'ICE201I E' in the DFSMSG output, you have that PTF. If you see 'ICE201I 0' in the DFSMSG output, you don't have that PTF, so ask your System Programmer to install it (it's free). Alternatively, you can do the INCLUDE and INREC in a separate COPY operator before the SELECT operator (use a temporary data set as the TO for the COPY and the FROM for the SELECT).

When I ran your job with the April, 2006 DFSORT PTF, OUT had:

Code:

PRDJOB1  9159    1   
PRDJOB2  9157    4   
PRDJOB3  9153    2   
PRDJOB5  9156    9   
PRDJOB8  9158    2   
Back to top
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Thu Oct 19, 2006 10:22 am
Reply with quote

Thanks Frank, We don't have the PTF you mentioned. I'll ask System programmer to install it.

Regards,
Ramanan R
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top