Iratxe
New User
Joined: 21 Feb 2006 Posts: 24
|
|
|
|
Hello,
I´ve got two files, File A (lrecl=80,recfm=fb) and that contains:
COLS> ----+----1----+
****** ***************
000001 002 CCCCC
000002 000 KKKKK
000003 004 GGGGG
and file B (lrecl=80,recfm=fb) contains:
COLS> ----+----1
****** **********
000001 2010-09-24
****** **********
and the output I want to find is:
COLS> ----+----1----+----2----+----3
****** **********************
000001 2010-09-24 002 CCCCC
000002 2010-09-24 000 KKKKK
000003 2010-09-24 004 GGGGG
How can I do this?. Thanks very much.
Iratxe |
|
prahalad
New User
Joined: 14 Sep 2010 Posts: 18 Location: Pune
|
|
|
|
It seems your file B has a record which contains a date field. You want to append that date in each record in file A. For doing this you can use the following code:
Code: |
//STPU080 EXEC PGM=SORT
//SORTJNF1 DD *
002 CCCCC
000 KKKKK
004 GGGGG
//SORTJNF2 DD *
2010-09-24
//JNF1CNTL DD *
INREC OVERLAY=(81:C'1')
//JNF2CNTL DD *
INREC OVERLAY=(81:C'1')
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(81,1,A),SORTED
JOINKEYS FILES=F2,FIELDS=(81,1,A),SORTED
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F2:1,11,F1:1,80)
SORT FIELDS=COPY
//SYSOUT DD SYSOUT=*
|
|
|