Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

change a character in a delimiter seperated file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: change a character in a delimiter seperated file
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 Moderator


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

PostPosted: Mon Aug 17, 2009 10:34 pm    Post subject:
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    Post subject: Reply to: change a character in a delimiter seperated file
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 Moderator


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

PostPosted: Mon Aug 17, 2009 10:43 pm    Post subject:
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    Post subject: Reply to: change a character in a delimiter seperated file
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 Moderator


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

PostPosted: Mon Aug 17, 2009 11:20 pm    Post subject:
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    Post subject: Reply to: change a character in a delimiter seperated file
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us