Page 2 of 2

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 10:10 pm
by Akatsukami
:: sigh :: This is the second time that you are told that DFSORT ≠ JCL.

Now, tell us about this moronic team lead of yours who slobbers that you may take a day to beg for sort control cards that you cannot devise for yourself, but may not take an hour to write a PL/I program that you can, and it may be that Mr Kolusu or someone else will have pity on you and give you the cards.

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 10:16 pm
by skolusu
priyasingh wrote:i need it in JCL only. Plz help. I need it urgently


Everyone does NOT work in the same timezone as you are working and please stop demanding solution. You neither provided the LRECL and RECFM of the input files involved nor you showed a sample of input and desired output, but you do demand a complete solution .

Use the following DFSORT JCL which will give you the desired results. I assumed that your input is RECFM=FB and LRECL=80
//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//INA      DD *                                 
RECORD # 1     2012-10-16                       
//INB      DD *                                 
RECORD # 2     2012-10-15                       
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                 
  OPTION COPY                                   
  JOINKEYS F1=INA,FIELDS=(81,8,A)               
  JOINKEYS F2=INB,FIELDS=(81,8,A)               
  JOIN UNPAIRED                                 
  REFORMAT FIELDS=(F1:1,80,?)                   
  INCLUDE COND=(81,1,CH,EQ,C'1')                 
  INREC BUILD=(1,80)                             
//*                                             
//JNF1CNTL DD *                                 
  OPTION STOPAFT=1                               
  INREC OVERLAY=(81:16,10,UFF,M11,LENGTH=8)     
//*                                             
//JNF2CNTL DD *                                 
  OPTION STOPAFT=1                               
  INREC OVERLAY=(81:16,10,UFF,M11,LENGTH=8)     
//*

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 10:18 pm
by BillyBoyo
If you look in the manual, you'll find the RC=8 is tough. You can have 12 :-)

//STEP0100 EXEC PGM=SORT
//CHKOUT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  JOINKEYS F1=INA,FIELDS=(81,1,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(81,1,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F1:16,10,F2:16,10)
  OUTFIL FNAMES=CHKOUT,NULLOFL=RC4,INCLUDE=(1,10,CH,LT,11,10,CH)
//JNF1CNTL DD *
 OPTION COPY,STOPAFT=1
 INREC OVERLAY=(81:C'1')
//JNF2CNTL DD *
 OPTION COPY,STOPAFT=1
 INREC OVERLAY=(81:C'1')
//INA      DD *
XXXXX           2012-MM-DD
2222
3333
4444
5555
6666
7777
//INB      DD *
XXXXX           2012-MM-DD
11111
77777


Ah... I'm "crossing in the post...", I see...

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 10:22 pm
by enrico-sorichetti
i need it in JCL only. Plz help. I need it urgently


if You need it urgently a forum is not the best place to ask,
as You know we reply on our own time and free of charge

You can ask people to accommodate Your time constraints only if You pay them :mrgreen:

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 10:29 pm
by priyasingh
thanks enrico,but i didnt ask that its compulsary for you to reply for my post.

Re: Plz help:need JCL to compare date field from two files

PostPosted: Mon Oct 15, 2012 10:35 pm
by BillyBoyo
You've got two solutions. Now you're moaning about it?

I'll make the same point as the other two. If you have to do something quickly, you have to it in something you know. Or you have to pay someone to do it in what you want.

Re: Plz help:need JCL to compare date field from two files

PostPosted: Tue Oct 16, 2012 12:12 am
by BillyBoyo
You have been given two solutions. Did you try either of them? Or did you just rely on contacting me directly? Doesn't work that way, not without payment, anyway.

Try the solutions. Let us know.

Re: Plz help:need JCL to compare date field from two files

PostPosted: Tue Oct 16, 2012 8:50 am
by dick scherrer
Hello,

thanks enrico,but i didnt ask that its compulsary for you to reply for my post.
No, you didn't. However, ypu will frequently receive replies that were not exactly what you were looking for.