sort

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
tamilselvan.sampath
Member
Posts: 26
Joined: Mon Jan 23, 2012 11:17 pm

sort

Post by tamilselvan.sampath » Fri Feb 24, 2012 7:05 pm

i have two files one is input and another is output.i have different data in both the files. i want to do like this

input file

12345
12345
72890

output file

asdff
ssssw
sssss

in the same output file i need to replace

12dff
12ssw
72sss

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sat Feb 25, 2012 12:08 am

First - a title of 'sort' for your topic in the DFSORT part of the forum is not exactly a brief description of your problem.
Second - how do you get that output from that input? What are the rules? Why does 12345 become both asdff and ssssw and why does 72890 become sssss. And how does the 12dff, 12ssw and 72sss get into your output file and what do you want to replace them by? Also, what is the RECFM and LRECL of these file?
Thirdly - what have you tried so far? Show us your efforts.
Regards
Nic

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Sat Feb 25, 2012 12:19 am

tamilselvan.sampath,

Assuming you want to join record-by-record from the two input files, you can use a DFSORT JOINKEYS job like the following:

Code: Select all

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD *
12345
12345
72890
//IN2 DD *
12dff
12ssw
72sss
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(81,8,A),SORTED,NOSEQCK
  JOINKEYS F2=IN2,FIELDS=(81,8,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F1:1,2,F2:3,3)
  OPTION COPY
  INREC OVERLAY=(80:X)
//JNF1CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,BI)
//JNF2CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,BI)
/*
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
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

tamilselvan.sampath
Member
Posts: 26
Joined: Mon Jan 23, 2012 11:17 pm

Post by tamilselvan.sampath » Sat Feb 25, 2012 8:40 am

hi frank,

we cant do without using joinkeys frank.

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Sat Feb 25, 2012 6:07 pm

What other hidden constraints do you have, reveal them please.
Regards,
Anuj

tamilselvan.sampath
Member
Posts: 26
Joined: Mon Jan 23, 2012 11:17 pm

Post by tamilselvan.sampath » Sat Feb 25, 2012 11:56 pm

sorry,i dont know..... thats why iam asking

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Feb 28, 2012 12:32 am

hi frank,

we cant do without using joinkeys frank.
I don't understand your question. Are you saying you can't use JOINKEYS? Or are you asking if there's another way to do it without JOINKEYS? If the latter, why do you need to do it without JOINKEYS?

I suppose it could be done with the SPLICE operator of DFSORT's ICETOOL if you can't use JOINKEYS.
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

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others