Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


SORT HELP

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
muraligaru1
Moderator


Joined: 11 Nov 2006
Posts: 43

PostPosted: Sat Feb 17, 2007 9:53 pm    Post subject: SORT HELP Reply with quote

Hi all,

Please give a solution for this problem.

I have multiple records with two fields.. name and description.
all the records has same name where name is the key.but description part is different.

Record structure look lilke....

David
David
David XXXXXXXXXXXXXX
David
David


Out of these records sort statement must pick only one and the only one should be that with description.

In case if all the records didnt have any description than any one of the record can be put in the output...


regards
Murali
Back to top
View user's profile Send private message

Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 487
Location: San Jose, CA

PostPosted: Sun Feb 18, 2007 10:54 pm    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
David
David
David XXXXXXXXXXXXXX
David
David
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
* Sort descending on description to make it the first record,
* if present.
  SORT FIELDS=(7,14,CH,D)
* Get the first record.
  OUTFIL ENDREC=1
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
muraligaru1
Moderator


Joined: 11 Nov 2006
Posts: 43

PostPosted: Mon Feb 19, 2007 3:22 am    Post subject: Reply with quote

Thank you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts compare 2 files with different LRECL 11 nina 4106 Wed Mar 18, 2009 1:58 pm
ksk View latest post
No new posts Copy records for matching key appearing at different places. 4 rangab 1666 Tue Feb 03, 2009 11:36 pm
rangab View latest post
No new posts Different forms of Case -when (loop handling) in Eazytrieve 2 Avani 4336 Thu Apr 05, 2007 8:25 pm
Veera View latest post
No new posts Reg: Different operating systems in mainframes 1 156138 2241 Wed Sep 20, 2006 12:21 pm
Krishna View latest post
No new posts What are all the COBOL compilers available? 4 Sweetu 5811 Fri Aug 25, 2006 12:59 pm
agkshirsagar View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB