Page 1 of 1

sort

Posted: Fri Feb 24, 2012 7:05 pm
by tamilselvan.sampath
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

Posted: Sat Feb 25, 2012 12:08 am
by NicC
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.

Posted: Sat Feb 25, 2012 12:19 am
by Frank Yaeger
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

Posted: Sat Feb 25, 2012 8:40 am
by tamilselvan.sampath
hi frank,

we cant do without using joinkeys frank.

Posted: Sat Feb 25, 2012 6:07 pm
by Anuj Dhawan
What other hidden constraints do you have, reveal them please.

Posted: Sat Feb 25, 2012 11:56 pm
by tamilselvan.sampath
sorry,i dont know..... thats why iam asking

Posted: Tue Feb 28, 2012 12:32 am
by Frank Yaeger
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.