IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

change a character in a delimiter seperated file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Aug 17, 2009 7:48 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 17, 2009 10:34 pm
Reply with quote

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
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Aug 17, 2009 10:39 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 17, 2009 10:43 pm
Reply with quote

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
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Aug 17, 2009 10:47 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 17, 2009 11:20 pm
Reply with quote

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
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Mon Aug 17, 2009 11:23 pm
Reply with quote

Hi Frank,

Thanks! I would.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top