View previous topic :: View next topic
|
Author |
Message |
theone1987
New User
Joined: 14 Sep 2009 Posts: 60 Location: Milan
|
|
|
|
hello everyone...i need help with icetool.
i have two input files with the same keys. In the output file I have to write ONLY the first part of the key (if at least some of the key changes).
ex.
file1
000000000000 2009/08/31 50
000000000001 2009/07/31 20
000000000002 2009/06/30 10
000000000003 2009/05/31 30
file2
000000000000 2009/08/31 50
000000000001 2009/08/31 20 date changed
000000000002 2009/06/30 30 changed the 3 part of the key(10->30)
000000000003 2009/05/31 30
fileout
000000000001
000000000002
i hope you understand!
thank you
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
What is the RECFM and LRECL of each input file?
What is the starting position, length and format of each field?
Can input file1 have duplicates within it? Can input file2 have duplicates within it? If either file can have dups within it, show a better example of input and expected output with dups. |
|
Back to top |
|
|
theone1987
New User
Joined: 14 Sep 2009 Posts: 60 Location: Milan
|
|
|
|
I need only three fields of the entire records.
input file 1 (LRECL = 290 FB)
field1: from position 10 long 40 (char)
field2: from position 52 long 10 (char)
field3: from position 62 long 10 (zoned)
input file1 can't have duplicates within it
input file 2 (LRECL = 290 FB)
field1: from position 1 long 40 (char)
field2: from position 10 long 10 (char)
field3: from position 32 long 10 (zoned)
input file2 can't have duplicates within it |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Sigh. What does "10 long 40" mean? What is "long"? Does it mean 10-40, or starting position is 10 and length is 40? Or what?
For input file 2, does 10 long 10 overlap 1 long 40?
Please use standard, understandable notation like:
Positions 1-40 (char)
or
starting position 1 and length 40 (char) |
|
Back to top |
|
|
theone1987
New User
Joined: 14 Sep 2009 Posts: 60 Location: Milan
|
|
|
|
sorry!
I need only three fields of the entire records.
input file 1 (LRECL = 290 FB)
field1:starting position 10 and length 40 (char)
field2:starting position 52 and length 10 (char)
field3:starting position 62 and length 10 (zoned)
input file1 can't have duplicates within it
input file 2 (LRECL = 290 FB)
field1:starting position 1 and length 40 (char)
field2:starting position 10 and length 10 (char)
field3:starting position 32 and length 10 (zoned)
input file2 can't have duplicates within it
i hope is clear now! |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Quote: |
I need only three fields of the entire records.
input file 1 (LRECL = 290 FB)
field1:starting position 10 and length 40 (char)
field2:starting position 52 and length 10 (char)
field3:starting position 62 and length 10 (zoned)
input file1 can't have duplicates within it
input file 2 (LRECL = 290 FB)
field1:starting position 1 and length 40 (char)
field2:starting position 10 and length 10 (char)
field3:starting position 32 and length 10 (zoned)
input file2 can't have duplicates within it
|
theone1987,
Arent the file 2 key values overlapping each other (field 2 and field 3 overlap field 1)? (highlighted in bold) . How can you compare the first file key of 40 bytes with file2 ? |
|
Back to top |
|
|
theone1987
New User
Joined: 14 Sep 2009 Posts: 60 Location: Milan
|
|
|
|
Skolusu wrote: |
Quote: |
I need only three fields of the entire records.
input file 1 (LRECL = 290 FB)
field1:starting position 10 and length 40 (char)
field2:starting position 52 and length 10 (char)
field3:starting position 62 and length 10 (zoned)
input file1 can't have duplicates within it
input file 2 (LRECL = 290 FB)
field1:starting position 1 and length 40 (char)
field2:starting position 10 and length 10 (char)
field3:starting position 32 and length 10 (zoned)
input file2 can't have duplicates within it
|
theone1987,
Arent the file 2 key values overlapping each other (field 2 and field 3 overlap field 1)? (highlighted in bold) . How can you compare the first file key of 40 bytes with file2 ? |
sorry again,
input file 2 (LRECL = 290 FB)
field1:starting position 1 and length 40 (char)
field2:starting position 42 and length 10 (char)
field3:starting position 53 and length 10 (zoned) |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=... input file1 (FB/290)
// DD DSN=... input file2 (FB/290)
//OUT DD DSN=... output file (FB/40)
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,40,CH) ON(41,10,CH) ON(51,10,ZD) -
NODUPS USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=(56,1,CH,EQ,C'/'),
BUILD=(1:10,40,41:52,10,51:62,10,61:C'1')),
IFTHEN=(WHEN=NONE,
BUILD=(1:1,40,41:42,10,51:53,10,61:C'2'))
OUTFIL FNAMES=OUT,INCLUDE=(61,1,CH,EQ,C'1'),BUILD=(1,40)
/*
|
|
|
Back to top |
|
|
theone1987
New User
Joined: 14 Sep 2009 Posts: 60 Location: Milan
|
|
|
|
THANK YOU VERY MUCH! |
|
Back to top |
|
|
|