View previous topic :: View next topic
|
Author |
Message |
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
I have a delimiter seperated file.
Input:
Code: |
123;ab;cde;fghi;12ed;1234
12;agv;eg;edftz;3se4t6;865432
|
I would like to change the letter 'e' to 'f', for ex, only in 3rd and 5th field and write it in the output file in the same delimiter seperated format as of input file.
Output:
Code: |
123;ab;cdf;fghi;12fd;1234
12;agv;fg;edftz;3sf4t6;865432
|
Note 1:
I don't have the July 2008 PTF, requested for the same though
Note 2:
In this input file i want to change for 3rd and 5th field. In other files, i might want to change for different fields. The field to be edited will be found out via REXX EXEC and the control card for SORT program is filled in the REXX exec. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
The field to be edited will be found out via REXX EXEC and the control card for SORT program is filled in the REXX exec. |
If you are going to use a REXX EXEC to determine the fields to be edited, why not use a REXX EXEC to do everything?
If you want to use DFSORT for this, you'd need to PARSE to separate out the fields you want, then use TRAN=ALTSEQ on those fields to replace 'e' with 'f' (you can't use FINDREP if you don't have the July, 2008 PTF) and then use SQZ to put the fields back in delimited form. But selecting the fields dynamically from a REXX EXEC makes this tricky. |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi Frank,
Quote: |
If you are going to use a REXX EXEC to determine the fields to be edited, why not use a REXX EXEC to do everything |
That's the last option I am thinking about. As the input file will be having huge no of records, reading each and every record in REXX, then changing the character would take lot of time than via DFSORT, i think.
Moreover the REXX exec will be in a cataloged procedure which will generate various sort control cards based on several criterias.
So I want to explore the possibilities in DFSORT first. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
What is the RECFM and LRECL of the input file?
What is the maximum length of each delimited field?
Can there be embedded blanks in a field (e.g. 123b4; where b is a blank)? |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi Frank,
The RECFM is FB.
Sorry, we would need to process different files of different LRECLs. So the LRECL would also be found out in the REXX exec.
As of now, I am not sure about the maximum length of each delimited field. probably it can be 80.
Yes, there can be embeeded blanks in a field. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Unfortunately, there are a lot of complications here and I don't have time to work this out for you. You'd have to work it out yourself based on the method I described earlier. |
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi Frank,
Thanks! I would. |
|
Back to top |
|
|
|