>>I am getting the o/p as expected , but not sure whether what i have done
is completely correct . Could you please check and let me know if the above
needs correction ?

Ron,

You are NOT getting the o/p as expected. You shouldn't be writing the
500000318 789997580026.00 36052911 DF  record as it does NOT have any
record with a price difference. You simply did not follow the directions
that I gave.

STEP 1 should be writing 2 files, but you only wrote 1 file and you added
your own logic of counts. Not sure as to why you need the counts.
Your Price starts at 65 and not 64.  I accidentally mentioned 64 and you
the owner of the data should be able to correct it to the right positions.

Since you had at least put in a effort and  tried to code the job based on
the directions, I will show you the optimized control cards. (please don't
expect it all the time)

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
500000338 789997580026.00 36052910 DF                           96.12
500000338 789997580026.00 36052910 DF                           96.12
500000338 789997580026.00 36052910 DF                           95.12
500000318 789997580026.00 36052910 DF                           95.12
500000318 789997580026.00 36052911 DF                           95.12
500000318 789997580026.00 36052911 DF                           95.12
//ORIG     DD DSN=&&INA,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//PULL     DD DSN=&&INB,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *
  SORT FIELDS=(1,37,CH,A)

  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'0')),
        IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,37),PUSH=(81:65,10)),
        IFTHEN=(WHEN=(65,10,CH,NE,81,10,CH),OVERLAY=(92:C'P'))

  OUTFIL FNAMES=ORIG,BUILD=(1,80)

  OUTFIL FNAMES=PULL,BUILD=(80X),
         REMOVECC,NODETAIL,
         INCLUDE=(92,1,CH,EQ,C'P'),
  SECTIONS=(1,37,TRAILER3=(1,37))
/*
//STEP0200 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//INA      DD DSN=&&INA,DISP=(OLD,DELETE)
//INB      DD DSN=&&INB,DISP=(OLD,DELETE)
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  JOINKEYS F1=INA,FIELDS=(1,37,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(1,37,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F1:1,80)
/*


The output from this job is

500000338 789997580026.00 36052910 DF                           96.12
500000338 789997580026.00 36052910 DF                           96.12
500000338 789997580026.00 36052910 DF                           95.12


Thanks,
Kolusu
DFSORT Development
IBM Corporation

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to