Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DFSORT Final output should not have duplicates of Column A

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DFSORT Final output should not have duplicates of Column A
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    Post subject: Re: How to use DFSORT?
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    Post subject:
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 Moderator


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

PostPosted: Tue Oct 17, 2006 8:34 pm    Post subject:
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    Post subject: Re: DFSORT Final output should not have duplicates of Column
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 Moderator


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

PostPosted: Wed Oct 18, 2006 10:14 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us