Page 1 of 1

join fields from two files

PostPosted: Mon Apr 23, 2012 3:33 pm
by muthu455
i have two files with a key in bytes 1-3 and data in bytes 5-9

my first input file is
000 $$$$$
001 aaaaa
002 ccccc
003 eeeee
004 ggggg
my second input file is
001 bbbbb
003 ddddd
004 fffff
005 hhhhh
i want the output like this
001 aaaaa bbbbb
003 eeeee ddddd
004 ggggg fffff

i have used the dfsort and joinkey like this
//xxxxxAB JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=xxxxx.MUTHU.PS,DISP=SHR
//SORTIN1 DD DSN=xxxxxx.MUTHU.PS1,DISP=SHR
//SORTOUT DD DSN=xxxxxx.MUTHU.PS2,DISP=OLD
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS F1=SORTIN,FIELDS=(1,3,A),SORTED
JOINKEYS F2=SORTIN2,FIELDS=(1,3,A),SORTED
REFORMAT FIELDS=(F1:1,9,F2:5,5)
OPTION COPY
OUTFIL FNAMES=SORTOUT,BUILD=(1,9,X,10,5)
/*

i am getting the maxcc=16 error
my error msg is
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 04:50 ON MON APR
JOINKEYS F1=SORTIN,FIELDS=(1,3,A),SORTED
$
ICE005A 0 STATEMENT DEFINER ERROR
JOINKEYS F2=SORTIN2,FIELDS=(1,3,A),SORTED
$
ICE005A 0 STATEMENT DEFINER ERROR
REFORMAT FIELDS=(F1:1,9,F2:5,5)
$
ICE005A 0 STATEMENT DEFINER ERROR
OPTION COPY
$
ICE005A 0 STATEMENT DEFINER ERROR
OUTFIL FNAMES=SORTOUT,BUILD=(1,9,X,10,5)
$
ICE005A 0 STATEMENT DEFINER ERROR
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
ICE751I 0 C5-BASE C6-BASE E7-BASE
ICE052I 3 END OF DFSORT

please correct my error

Re: join fields from two files

PostPosted: Mon Apr 23, 2012 3:46 pm
by BillyBoyo
Column one of Sort control cards must be left blank.

The manuals for DFSORT are available on the web, and clearly describe this. They include a "getting started" guide, to get you started, with clear and well-explained examples.

Other than not starting in the correct column, your code looks OK - you could also turn off the sequence checking for both the JOINKEYS statements if you don't need confirmation that the data is in the sequence you expect.

Re: join fields from two files

PostPosted: Mon Apr 23, 2012 4:03 pm
by muthu455
k i mad the sort controal cards blank still i'm getting the same error only
so please give the correct solution

Re: join fields from two files

PostPosted: Mon Apr 23, 2012 4:10 pm
by BillyBoyo
JOINKEYS F1=SORTIN,FIELDS=(1,3,A),SORTED   
JOINKEYS F2=SORTIN2,FIELDS=(1,3,A),SORTED 
REFORMAT FIELDS=(F1:1,9,F2:5,5)           
OPTION COPY                               
OUTFIL FNAMES=SORTOUT,BUILD=(1,9,X,10,5)   


Here are your original cards.

Did you try them like this?

  JOINKEYS F1=SORTIN,FIELDS=(1,3,A),SORTED   
  JOINKEYS F2=SORTIN2,FIELDS=(1,3,A),SORTED   
  REFORMAT FIELDS=(F1:1,9,F2:5,5)             
  OPTION COPY                               
  OUTFIL FNAMES=SORTOUT,BUILD=(1,9,X,10,5)


If you can't get it going, post the control cards, and the output messages, all in the Code tags, please.

Re: join fields from two files

PostPosted: Mon Apr 23, 2012 4:15 pm
by muthu455
//zzzzzzzz JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=zzzzzz.MUTHU.PS,DISP=SHR
//SORTIN1 DD DSN=zzzzz0.MUTHU.PS1,DISP=SHR
//SORTOUT DD DSN=zzzzz.MUTHU.PS2,DISP=OLD
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS F1=SORTIN,FIELDS=(1,3,A),SORTED
JOINKEYS F2=SORTIN2,FIELDS=(1,3,A),SORTED
REFORMAT FIELDS=(F1:1,9,F2:5,5)
OPTION COPY
OUTFIL FNAMES=SORTOUT,BUILD=(1,9,X,10,5)
/*
i made the changes like this but still i'm getting the error
my error message like this
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 05:40 ON MON APR
JOINKEYS F1=SORTIN,FIELDS=(1,3,A),SORTED
$
ICE005A 0 STATEMENT DEFINER ERROR
JOINKEYS F2=SORTIN2,FIELDS=(1,3,A),SORTED
$
ICE005A 0 STATEMENT DEFINER ERROR
REFORMAT FIELDS=(F1:1,9,F2:5,5)
$
ICE005A 0 STATEMENT DEFINER ERROR
OPTION COPY
OUTFIL FNAMES=SORTOUT,BUILD=(1,9,X,10,5)
$
ICE213A 0 INVALID OUTFIL STATEMENT OPERAND
ICE751I 0 C5-BASE C6-BASE C7-BASE C8-Q83041 E7-BASE
ICE052I 3 END OF DFSORT

Re: join fields from two files

PostPosted: Mon Apr 23, 2012 4:31 pm
by BillyBoyo
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5


I think that is going to be your problem.

You are using a very old DFSORT, which just does not have JOINKEYS in it.

I suggest you talk to your trainer/boss.

I've now looked at your JCL, Not that it matters, but it wouldn't work the way you have your DDs named.

Re: join fields from two files

PostPosted: Mon Apr 23, 2012 11:01 pm
by NicC
Apart from that, you will notice that what you have posted has had the leading blanks stripped. If you put code tags around your screenshots then you will get output as per BillyBoyos's previous post. You can manually insert the code tags or use the full editor, highlight the code to be coded and click the Code button.

Re: join fields from two files

PostPosted: Mon Apr 23, 2012 11:21 pm
by Frank Yaeger
muthu455,

The version of DFSORT and z/OS you are using are no longer supported, and your site has NOT even kept up with the DFSORT PTFs available, so you can't use most of the newer DFSORT functions.

Ask your System Programmers why they are still on an unsupported z/OS release.

Please don't post any more "why doesn't it work" questions - the answer is inevitably that you are using a very old, unsupported version of z/OS and DFSORT.