View previous topic :: View next topic
|
Author |
Message |
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Hi,
I have a File A - many records - Its FB , lrecl=183
Code: |
AAAA12-31-9999yyyy98.8908
AAAA02-18-2006vterg98.8908
AAAA10-10-2006yyyy98.8908 |
and FILE B only one record, it is FB, Lrecl = 378
Code: |
BBBByunheea098798YBGT01-01-2007y657980.00 |
I want to find the date
from FILE A and replace it with the date from FILEB
.
Is there any way to do it in a JCL? pls help
Thanks,
Viji |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Is the date location in FILE A always the same?
Do you have DFSORT? |
|
Back to top |
|
|
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Yes. the location of the date field in both the files are always same.
Yes I have DFSORT. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Viji,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input fileB (FB/378)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(C'Newdate,C''',22,10,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input fileA (FB/183)
//SORTOUT DD DSN=... output file (FB/183)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(5,10,CH,EQ,C'12-31-9999'),
OVERLAY=(5:Newdate))
/*
|
|
|
Back to top |
|
|
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Thanks Frank.
It worked out fine. I was not aware of OVERLAY function using literal substitutes. Can you sugesst me any link to read more about these features.
Thanks,
Viji |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|