update colums, if match found in file1 and file2.
Posted: Wed Jan 04, 2023 8:46 pm
Hi all, how to update colums, if match found in file1 and file2.
Can anyone help
Can anyone help
Code: Select all
//JKE1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
Roses 03 Red
Daisies 06 Orange
Roses 04 Pink
Daisies 02 Yellow
Roses 06 Yellow
Daisies 12 Lilac
Roses 09 Blue
/*
//SORTJNF2 DD *
Red Lilies InStock
Red Roses InStock
Orange Daisies SoldOut
Pink Roses SoldOut
Yellow Daisies InStock
Yellow Roses Ordered
Lilac Daisies SoldOut
White Daisies InStock
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
* Control statements for JOINKEYS application
JOINKEYS FILE=F1,FIELDS=(1,15,A,20,8,A)
JOINKEYS FILE=F2,FIELDS=(10,15,A,1,8,A)
REFORMAT FIELDS=(F1:20,8,1,15,F2:26,10,F1:16,2)
* Control statements for main task (joined records)
OPTION COPY
OUTFIL REMOVECC,
HEADER2=(1:'Color',11:'Flower',26:'Status',36:'Per Pot',/,
1:7'-',11:14'-',26:7'-',36:7'-'),
BUILD=(1:1,8,11:9,15,26:24,10,
36:34,2,ZD,M10,LENGTH=7)
/*Code: Select all
Color Flower Status Per Pot
------- -------------- ------- -------
Lilac Daisies SoldOut 12
Orange Daisies SoldOut 6
Yellow Daisies InStock 2
Pink Roses SoldOut 4
Red Roses InStock 3
Yellow Roses Ordered 6