Page 1 of 2

maching of files using ICETOOL

PostPosted: Mon Feb 25, 2008 8:58 pm
by pulcinella
Hi,

I need compare a field of x files order by the same key for know if the field is distint respect and the first file.

file 1 (16 positions)

field1 field2
uuuuuuuu AAAAAAAA
vvvvvvvv BBBBBBBB
xxxxxxxx AAAAAAAA
yyyyyyyy CCCCCCCC
zzzzzzzz AAAAAAAA

file 2 (16 positions)

field1 field2
uuuuuuuu
vvvvvvvv BBBBBBBB
xxxxxxxx AAAAAAAA
yyyyyyyy DDDDDDDD
zzzzzzzz AAAAAAAA

file output (16 or 24 position)

field1 field2
uuuuuuuu
yyyyyyyy

I don't know if in output file I can put the field2 of the first file and the field2 of the second file (is the reason that i put 16 or 24 position)... Can I make the match by x files order by the same keys of course?

Thanks

Re: maching of files using ICETOOL

PostPosted: Mon Feb 25, 2008 9:55 pm
by Frank Yaeger
You can use a DFSORT/ICETOOL job like this to do what I think you asked for.

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON DD *
uuuuuuuu AAAAAAAA
vvvvvvvv BBBBBBBB
xxxxxxxx AAAAAAAA
yyyyyyyy CCCCCCCC
zzzzzzzz AAAAAAAA
/*
// DD *
uuuuuuuu
vvvvvvvv BBBBBBBB
xxxxxxxx AAAAAAAA
yyyyyyyy DDDDDDDD
zzzzzzzz AAAAAAAA
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,17,CH) NODUPS USING(CTL1)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,
    SECTIONS=(1,8,TRAILER3=(1,8))
/*

Re: maching of files using ICETOOL

PostPosted: Tue Mar 18, 2008 10:52 pm
by pulcinella
Thanks Frank,
In case of I want join 3 files with distint position (first 16 positions, second 36 positions and third 40 positions) with the first 8 position identically (the order fields is distint) How is it?
I think that the question is easy but If you want more explications, I haven't problem to send the necesary explications
Thanks

Re: maching of files using ICETOOL

PostPosted: Wed Mar 19, 2008 2:45 am
by Frank Yaeger
Please show an example of the records in each input file and the expected output records and explain the "rules" for getting from input to output. Also give the RECFM and LRECL of each input file and the starting position, length and format of each relevant field.

Re: maching of files using ICETOOL

PostPosted: Wed Mar 19, 2008 1:20 pm
by pulcinella
I explain better,

file 1 (35 position)

AAAAAAAAxxxxxyyyyzzzvvvvuuuuttxxxxx
BBBBBBBBxxxxxyyyyzzzvvvvuuuuttxxxxx
DDDDDDDDrrrrrttttpppqqqqsssshhbbbbb
GGGGGGGGxxxxxyyyyzzzvvvvuuuuttxxxxx
JJJJJJJJzzzzzeeeegggvvvvnnnnaaiiiii


file 2 (42 position)

AAAAAAAAaaaabbbcccbbbeeetttuuuhhhuuufffggg
CCCCCCCCaaaabbbcccbbbeeetttuuuhhhuuufffggg
DDDDDDDDddddkkkiiipppxxxrrrpppqqqyyyzzzbbb
JJJJJJJJwwwwpppuuusssgggkkkllldddqqqfffggg

I pretend obtain a third file with the sum of the two input files (69 position, how can I see, I don't want duplicate the key when I make the join). The keys in the two input files are the first 8 position. Two input files are always ordered and only I want obtain the record with the keys are the same

This is:

file 3 (77 position)

AAAAAAAAxxxxxyyyyzzzvvvvuuuuttxxxxxaaaabbbcccbbbeeetttuuuhhhuuufffggg
DDDDDDDDrrrrrttttpppqqqqsssshhbbbbbddddkkkiiipppxxxrrrpppqqqyyyzzzbbb
JJJJJJJJzzzzzeeeegggvvvvnnnnaaiiiiiwwwwpppuuusssgggkkkllldddqqqfffggg

The key are the same; the other fields can be different but it's not relevant. I only need make a join with two files. I could made with a program but I have interested in a JCL.

Other question (this is not important because I can made an OUTREC after the JOIN) If i don't want to obtain all fields and i want only position, Could I make?

file 3 (41 position)

AAAAAAAAxxxxxzzzvvvvtt bbbccceeetttfffggg
DDDDDDDDrrrrrpppqqqqhh kkkiiixxxrrrzzzbbb
JJJJJJJJzzzzzgggvvvvaa pppuuugggkkkfffggg

Re: maching of files using ICETOOL

PostPosted: Wed Mar 19, 2008 10:24 pm
by Frank Yaeger
For your first question, here's a DFSORT/ICETOOL job that will do what you asked for:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,8,CH) -
  WITH(36,34)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(77:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,8,36:9,34,77:X)
/*


For your second question, here's a DFSORT/ICETOOL job that will do what you asked for:

//S2    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//T1 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,8,CH) -
  WITH(36,34) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(77:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,8,36:9,34,77:X)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,
    BUILD=(1,13,18,7,29,2,X,40,6,49,6,64,6)
/*

Re: maching of files using ICETOOL

PostPosted: Tue Apr 01, 2008 4:13 pm
by pulcinella
Excuse me Frank,

In the first example, I don't understand the line "WITH(36,34)", the line "INREC BUILD=(1,8,36:9,34,77:X)"
In the second example, I don't understand the line "BUILD=(1,13,18,7,29,2,X,40,6,49,6,64,6)"

Could me explain better, please?

Thanks

Re: maching of files using ICETOOL

PostPosted: Tue Apr 01, 2008 8:44 pm
by Frank Yaeger
INREC BUILD=(1,8,36:9,34,77:X)

Reformats the records as follows:

1-8 = input positions 1-8
36-69 = input positions 9-42
77:X = sets the record length to 77 bytes

WITH(36,34)

For records with the same value in positions 1-8, splices the value in positions 36-69 of the second record into the first record.

BUILD=(1,13,18,7,29,2,X,40,6,49,6,64,6)

Reformats the records with the specified fields (p,m) and a blank (X).

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/servers/storage/supp ... tmpub.html

Re: maching of files using ICETOOL

PostPosted: Thu Apr 24, 2008 1:41 pm
by pulcinella
Hello,

Refered to question of the post... If i want the join two files: the first with a 387 length, the second with a 19
position, the key in the two files are the first 12 position and obtain a third file of 394 length (I don't duplicate
the keys of the second file: 387+7). The example is the same of the first explain. I used the next sentence but I can't
get it. What is the problem? (the error is: INCONSISTENT *INREC IFTHEN 0 REFORMATTING FIELD FOUND)


//STEP032 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1
//IN2 DD DSN=... input file2
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,12,CH) -
WITH(388,7)
//CTL1CNTL DD *
INREC OVERLAY=(382:X)
//CTL2CNTL DD *
INREC BUILD=(1,12,388:13,7,382:X)
/*


If i want join a third file of 42 lenght (the first 12 are key) and the output file is 424 lenght (387+19+42-12-12)

Re: maching of files using ICETOOL

PostPosted: Thu Apr 24, 2008 8:52 pm
by Frank Yaeger
Your first INREC should have 394:X, not 382:X.

You got the error message for the second INREC because you have overlapping output columns. You have 388:13,7 followed by 382:X. 382: is less than the previous output field which is invalid for BUILD. I don't know why you have 382:X - maybe you meant to have 394:X, but you shouldn't have that either since 388:13,7 gets you to position 394 so 394:X would be an overlap as well. The INREC should have BUILD=(1,12,388:13,7).