join fields from two files



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

join fields from two files

Postby muthu455 » Mon Apr 23, 2012 3:33 pm

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
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: join fields from two files

 

Re: join fields from two files

Postby BillyBoyo » Mon Apr 23, 2012 3:46 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: join fields from two files

Postby muthu455 » Mon Apr 23, 2012 4:03 pm

k i mad the sort controal cards blank still i'm getting the same error only
so please give the correct solution
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: join fields from two files

Postby BillyBoyo » Mon Apr 23, 2012 4:10 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: join fields from two files

Postby muthu455 » Mon Apr 23, 2012 4:15 pm

//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
muthu455
 
Posts: 21
Joined: Sat Apr 14, 2012 3:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: join fields from two files

Postby BillyBoyo » Mon Apr 23, 2012 4:31 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: join fields from two files

Postby NicC » Mon Apr 23, 2012 11:01 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: join fields from two files

Postby Frank Yaeger » Mon Apr 23, 2012 11:21 pm

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.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post