View previous topic :: View next topic
|
Author |
Message |
thisak
New User
Joined: 09 Jun 2006 Posts: 14
|
|
|
|
I have 2 fields starting from postion 1 and another from 11.
I may get spaces in between digits (for eg. "5 0 234") and without disturbing them, I need to suppress leading blanks alone. I'm not sure how blank spaces will be there at starting.
The below code I have written replaces all space which I don't want.
INREC IFTHEN=(WHEN=INIT,OVERLAY=(1:1,10,JFY=(SHIFT=RIGHT),
11:11,5,JFY=(SHIFT=RIGHT))),
IFTHEN=(WHEN=INIT,FINDREP=(IN=C' ',OUT=C'0'))
Is there any correct way to attain this? |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
thisak,
Please provide sample input records and expected output. Try to cover all the situations. Also provide us with LRECL and RECFM for the input file and expected output.
Thanks, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
thisak,
Your description is thoroughly confusing. What do you mean by "without disturbing them"? What do you mean by "suppress leading blanks alone"?
You need to do a much better job of describing what it is you want to do before anyone can help you. Show an example of your input records and what you expect for output and explain the rules for getting from input to output.
To get you started, if you had these input records:
Code: |
fld1------fld2-
5 0 234 5 0 2
1 2 3 980
0 05 34 1
1 5 4 1
|
What would you expect for the output records? |
|
Back to top |
|
|
|