Page 1 of 1

How can i do it using sort with overlay parameter

PostPosted: Fri Sep 07, 2007 3:51 pm
by Indranil28
i have 2 files of input length 80.

first file has 09-11-2007 and second file has 03-27-2005.. In output i want the 2nd file as 03-11-2005.

How can i do it using sort with overlay parameter?

Re: How can i do it using sort with overlay parameter

PostPosted: Fri Sep 07, 2007 6:11 pm
by CICS Guy
I'd bet that between the last example and a sort manual, you could probably work this one out on your own..... ;)

Re: How can i do it using sort with overlay parameter

PostPosted: Fri Sep 07, 2007 9:00 pm
by Frank Yaeger
Indranil28,

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

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
09-11-2007
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT symbol as follows:
* F1,'dd'
* where dd is the day from the file1 record
  INREC BUILD=(C'F1,''',4,2,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
03-27-2005
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
* Use F1 symbol to overlay dd in the file2 record
  INREC OVERLAY=(4:F1)
/*