On Jul 28, 1:43 pm, Willy Jensen wrote:
> Hi, I am trying to splice a set of datarecords with a lookup table.
> My aim is to to add the contents from matching lookup records to the
> data file. The front part of the lookup record should overlay the
> empty front part of data records with matching key (col 1).
> I have been reading the SORT / ICETOOLS manual, and though SPLICE
> looked promising, I could not get it to do what I wanted,
> I have tried to outline the basics here, where the byte in the 1st
> char is the 'slice' control. The sample do not look too good with
> proportional font, but I hope that you get the idea.
>
> Is this possible at all with sort? Any other suggestions ? All
> comments are welcome.
>
> Lookup file:
>
> 1      20080506 20080508
> 2      00000000 00000000
>
> Data file
>
> 1                        20080506 DATA1
> 1                        20080506 DATA2
> 1                        20080506 DATA3
> 3                        20080506 DATA4
>
> Output file
>
> 1      20080506 20080508 20080506          DATA RECORD 1
> 1      20080506 20080508 20080506          DATA RECORD 2
> 1      20080506 20080508 20080506          DATA RECORD 3
> 2      00000000 00000000
> 3                        20080506          DATA RECORD 4

Willy,

You can use a DFSORT/ICETOOL job like the following to do what you asked
for:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//CON DD *
1      20080506 20080508
2      00000000 00000000
/*
//    DD *
1                        20080506 DATA1
1                        20080506 DATA2
1                        20080506 DATA3
3                        20080506 DATA4
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(CON) TO(OUT) ON(1,1,CH) WITHALL KEEPNODUPS -
  WITH(26,14) USING(CTL1)
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,
    IFTHEN=(WHEN=(35,4,CH,NE,C' '),
      BUILD=(1,33,44:35,4,C' RECORD ',39,1))
/*

Frank Yaeger - DFSORT Development Team (IBM) - [EMAIL PROTECTED]
Specialties: FINDREP, WHEN=GROUP, DATASORT, ICETOOL, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to