View previous topic :: View next topic
|
Author |
Message |
THINKSRINIII Warnings : 1 New User
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
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 |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
SAS solution OK? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
VishnuPrakash
New User
Joined: 10 Jun 2010 Posts: 10 Location: Bangalore
|
|
|
|
We can do this in REXX.... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
VishnuPrakash
New User
Joined: 10 Jun 2010 Posts: 10 Location: Bangalore
|
|
|
|
@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 |
|
|
|