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 two files with same sort condition

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


Joined: 13 Nov 2007
Posts: 11

PostPosted: Wed Jan 02, 2008 7:25 pm    Post subject: sort two files with same sort condition Reply with quote

how to sort two files with same sort cond n write it into two diff output files

That is to be still more clear,
i have two input files: input1 and input2

i have to sort the files with same sort condt: sort fields=copy

and need two diff output files : output1(corresponding to input1) and output2(corresponding to input2)

tis is possible with two sort steps..
but is there any way to have this process in a single sort step??
_________________
anu
Back to top
View user's profile Send private message

Frank Yaeger
Moderator


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

PostPosted: Wed Jan 02, 2008 8:51 pm    Post subject: Reply with quote

Your explanation of what you want to do is very unclear.

Quote:
i have to sort the files with same sort condt: sort fields=copy


SORT FIELDS=COPY copies the files - it does NOT sort them. So I have no idea what it is you're trying to do.

Show an example of the records in each input file and the records you expect in each output file, and explain the rules for getting from input to output. Give the RECFM and LRECL of the input files. Give the starting position, length and format of each relevant field (if any).
_________________
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
anu.slaksh
Member


Joined: 13 Nov 2007
Posts: 11

PostPosted: Thu Jan 03, 2008 6:27 pm    Post subject: Reply with quote

ok, here is an example:
Input file 1: Lrecl = 80
Input file 2: Lrecl = 120

Sort cond : sort field= (9,9,ch,a)

output file 1: Lrecl = 80
Output file 2: Lrecl = 120

I want to sort two different files with same sort condition and write it into two different corresponding output files..

Is there any way to do this in a single step.. instead of two steps for each file??

do u want me to be still more clear?? please do let me know
_________________
anu
Back to top
View user's profile Send private message
Frank Yaeger
Moderator


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

PostPosted: Thu Jan 03, 2008 9:12 pm    Post subject: Reply with quote

You can do it in one step with DFSORT's ICETOOL as follows (but it will take two passes):

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/120)
//OUT1 DD DSN=...  output file1 (FB/80)
//OUT2 DD DSN=...  output file2 (FB/120)
//TOOLIN DD *
SORT FROM(IN1) TO(OUT1) USING(CTL1)
SORT FROM(IN2) TO(OUT2) USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(9,9,CH,A)
/*

_________________
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
yamank
Member


Joined: 14 Jan 2008
Posts: 2
Location: bangalore

PostPosted: Fri Jan 25, 2008 12:33 pm    Post subject: its a really good Reply with quote

hi
this is really a good thing to improve the knowledge.
i am a fresher so its very good site for me.
Back to top
View user's profile Send private message Yahoo Messenger
arrbee
Active Member


Joined: 24 Feb 2006
Posts: 147

PostPosted: Wed Mar 05, 2008 7:58 pm    Post subject: Reply with quote

WOW......this is really nice trick.....

Would anybody please suggest a syncsort version of this?

Thx.
_________________
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)
Back to top
View user's profile Send private message Send e-mail
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 Merging two files into one based on certain key fields: 4 MVS_blob 4513 Thu Oct 25, 2007 9:06 pm
Frank Yaeger View latest post
No new posts compare two files and write duplicate records to file no dup 3 mainframeman 9393 Wed Dec 20, 2006 1:53 am
Frank Yaeger View latest post
No new posts 2 Phase commit 3 156138 2178 Mon Nov 27, 2006 5:05 pm
kalva View latest post
No new posts comparing two flat files 10 abhishek.pradhan 5054 Fri Nov 24, 2006 9:42 am
abhishek.pradhan View latest post
This topic is locked: you cannot edit posts or make replies. To compare two files (SSN fields) 20 vikasbs 11255 Thu Nov 09, 2006 9:55 pm
Frank Yaeger 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