View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
The data in the file before the field is inserted is like
File is a VB and length is 139 before inserting the field.
H.2008-01-01.07:28:07. 541
J.A00.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.85%
J.A01.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.90%
J.A02.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.95%
J.A03.V .00..00..00.2099-06-30.Ulster Bank Base Rate+1%
Now I need to insert a new field at the 3rd position of the file
and the data looks like this after inserting the field
Here we have inserted the '986550.'
H.2008-01-01.07:28:07. 541
J.986550.A00.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.85%
J.986550.A01.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.90%
J.986550.A02.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.95%
J.986550.A03.V .00..00..00.2099-06-30.Ulster Bank Base Rate+1% |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. Note the use of IFTHEN to avoid changing the H record.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB)
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(5,1,CH,NE,C'H'),
BUILD=(1,6,C'986550.',7))
/*
|
|
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Thanks Frank
It works for me.
Can you let me know how to handle the same using the OUTREC |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Can you let me know how to handle the same using the OUTREC
|
INREC and OUTREC are interchangeable in this situation, so there's no reason to use OUTREC rather than INREC. But if you want to use OUTREC, you can just change INREC to OUTREC:
Code: |
OUTREC IFTHEN=(WHEN=(5,1,CH,NE,C'H'),
BUILD=(1,6,C'986550.',7))
|
|
|
Back to top |
|
|
|