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
 

 

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: 962
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: 6967
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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