Page 1 of 1

ICETOOL and SPLICE Operator

PostPosted: Thu Dec 04, 2008 7:33 pm
by hugol
I have 2 input records. in file one i have some account numbers block. in file 2 i have all the accounts numbers and other data. i want to keep the file 2 but with the accounts that are not in file 1...i just want the active accounts...

Re: icetool- splice

PostPosted: Thu Dec 04, 2008 9:53 pm
by Frank Yaeger
Please show an example of the records in each input file and what you expect for output. Explain the "rules" for getting from input to output. If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it, show that in your example. Give the RECFM and LRECL of each input file. Give the starting position, length and format of each relevant field.

Re: icetool- splice

PostPosted: Thu Dec 04, 2008 10:15 pm
by hugol
sorry i forget to post the code....
the relevent fields i want are the first 20, they start in position 1 and finish in position 20, its alphanumeric.. both files are FB, record lenght of file one 113, but im not interested in all the data just part of it, second file record lenght is 290, the same of file one.
the code i made is this:

<code deleted>

Re: icetool- splice

PostPosted: Thu Dec 04, 2008 11:35 pm
by Frank Yaeger
You posted your code - I deleted it. I don't want to see YOUR code. I want you to tell me what you want to do in detail with good examples of input and output so I can show you the correct code. Please give me all of the information I asked for in my first post.

Re: icetool- splice

PostPosted: Thu Dec 04, 2008 11:59 pm
by hugol
sorry all the inconvinients...
i have two input files, file 1 is un unload of accounts and other data, file 2 have accounts number that no longer exists, i want as an output file 1 but without the accounts that are in file two, i have to quit in file 1 the accounts that are in file 2.


There will be no duplicate accounts number in file 1 or in file 2

Account number (1,20,CH)

FILE 1 --RECFM= FB, LRECL=50

0AAA000A111111111111XXXX-XX-XXXXXXXX-XX-XXXXXXXXXX
0AAA000A222222222222XXXX-XX-XXXXXXXX-XX-XXXXXXXXXX
0AAA000A333333333333XXXX-XX-XXXXXXXX-XX-XXXXXXXXXX
0AAB000B444444444444XXXX-XX-XXXXXXXX-XX-XXXXXXXXXX
0AAB000B555555555555XXXX-XX-XXXXXXXX-XX-XXXXXXXXXX

FILE 2 --RECFM= FB, LRECL=20

0AAA000A222222222222
0AAA000A333333333333

OUTPUT FILE
0AAA000A111111111111XXXX-XX-XXXXXXXX-XX-XXXXXXXXXX
0AAB000B444444444444XXXX-XX-XXXXXXXX-XX-XXXXXXXXXX
0AAB000B555555555555XXXX-XX-XXXXXXXX-XX-XXXXXXXXXX

Re: icetool- splice

PostPosted: Fri Dec 05, 2008 1:54 am
by Frank Yaeger
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 (FB/50)
//IN2 DD DSN=...  input file2 (FB/20)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/50)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,20,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(51:C'1')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(51:C'2')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(51,1,CH,EQ,C'1'),
    BUILD=(1,50)
/*

Re: icetool- splice

PostPosted: Fri Dec 05, 2008 5:48 pm
by hugol
thanks!!!