|
|
| Author |
Message |
mohanrazz
New User
Joined: 30 Sep 2008 Posts: 18 Location: India
|
|
|
|
Hi,
I have two input files and I have to generate third output file. Requirement is as below.
From 11th to 12th charecters of the second input file need to be replaced with 1th to 12th charecters of the first input file - and generate the third output file
Thanks in advance |
|
| Back to top |
|
 |
References
|
|
 |
bipinpeter
New User
Joined: 18 Jun 2007 Posts: 47 Location: pune
|
|
|
|
Hi mohanrazz,
Your requirement is not much clear.What you mean by "From 11th to 12th charecters of the second input file need to be replaced with 1th to 12th charecters of the first input file".
Replace the character if the two files have a common key? or
To replace the character in the 1 record in first file with 1st record in second file..2 record in 1st file 2nd record in 2nd file.... is it like that? |
|
| Back to top |
|
 |
mohanrazz
New User
Joined: 30 Sep 2008 Posts: 18 Location: India
|
|
|
|
bipin,
first file
| Code: |
| abcdefghij12klmnopqrst |
second file
my output file should be
| Code: |
| abcdefghij89klmnopqrst |
that means 12 (11th and 12th chars of first file) are replaced by 89 (11th and 12th chars of second file) -
Pls let me know how to do that in jcl
thanks. |
|
| Back to top |
|
 |
mohanrazz
New User
Joined: 30 Sep 2008 Posts: 18 Location: India
|
|
|
|
| Also both the files have only one record each |
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 399 Location: San Jose
|
|
|
|
mohanrazz,
Use the following DFSORT JCL if both files are of the same LRECL and RECFM
| Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDEFGHIJ12KLMNOPQRST
// DD *
89
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION EQUALS,ZDPRINT
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,1,ZD)),
IFTHEN=(WHEN=(81,1,ZD,EQ,1),OVERLAY=(11:C'00')),
IFTHEN=(WHEN=(81,1,ZD,EQ,2),OVERLAY=(81:C'1'))
SORT FIELDS=(81,1,CH,A)
SUM FIELDS=(11,2,ZD)
OUTFIL BUILD=(1,80)
/*
|
And if the files are of different LRECL then use the following DFSORT JCL
| Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
89
//SORTOUT DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(C'SRNO,C''',11,2,C'''',80:X)
/*
//STEP0200 EXEC PGM=ICEMAN
//SYMNAMES DD DSN=&&T1,DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDEFGHIJ12KLMNOPQRST
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(11:SRNO)
/*
|
|
|
| Back to top |
|
 |
|
|
|