Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Identify the 'n' th occurance of a character in a record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Fri Nov 05, 2010 6:42 am    Post subject: Identify the 'n' th occurance of a character in a record
Reply with quote

Hi ,

Could you please help me with this

Input: VB file of LRECL 259
Output: VB file of LRECL 259

Need to find the 15th occurance of '|' symbol in every line and need to check if the next character is also'|', if yes then insert a zero between the '|' symbols and write the entire record in the output file, else write the input record as it is to the output file.

Many thanks.
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 965
Location: Richmond, Virginia

PostPosted: Fri Nov 05, 2010 9:07 pm    Post subject:
Reply with quote

SAS solution OK?
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: Sat Nov 06, 2010 12:04 am    Post subject:
Reply with quote

THINKSRINIII,

Please show an example of the records in your input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output with respect to the example.
Back to top
View user's profile Send private message
VishnuPrakash

New User


Joined: 10 Jun 2010
Posts: 10
Location: Bangalore

PostPosted: Sat Nov 06, 2010 12:13 am    Post subject:
Reply with quote



We can do this in REXX....
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Sat Nov 06, 2010 2:10 am    Post subject:
Reply with quote

keep in mind:

if you take a 259 input
add 1 char
output will be 260
VishnuPrakash wrote:
We can do this in REXX.


VishnuPrakash,

what if there are 500,000 records in the file?
for a small file, yes you can code a REXX Script,
but by the time you have written the script (to account for large files) , and tested it
you could come up with the Sort CONTROL Cards,
COPY,
.....
never have to worry about file size,
and the execution time for large files would be not acceptable for a script, where as a Sort solution would be very fast.

think about the consequences of your suggestions and
when there are things to consider, include them in you suggestion.

Welcome to the forum, by the way.
yes, a REXX Script could be a solution, but not the best.
and, it is common practice to provide the Script, if that is your suggestion.
But, keep in mind this is a DFSORT forum,
and the TS requested a DFSORT solution.
Back to top
View user's profile Send private message
VishnuPrakash

New User


Joined: 10 Jun 2010
Posts: 10
Location: Bangalore

PostPosted: Mon Nov 08, 2010 12:03 pm    Post subject:
Reply with quote

@dbzTHEdinosauer

Yes you are correct.... REXX cannot handle large number of records at a time..but if the file size is small we can use REXX....any how i did not think till that extent....

Thank you for welcoming me to the Forum...
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us