View previous topic :: View next topic
|
Author |
Message |
psriv20 Currently Banned New User
Joined: 25 May 2009 Posts: 19 Location: Pune
|
|
|
|
I have a big file which is work as input file for a program A. I ran the the job and it is giving SOC7. I analysed it and found that at cols 45 to 48 expected value should be numeric but there is some space. I want to remove the spaces.
For ex.
Current file:
AAAAAAAA BBBBBBBBBBB
I want
AAAAAAAABBBBBBBBBBB
Thanks |
|
Back to top |
|
|
prahalad
New User
Joined: 14 Sep 2010 Posts: 18 Location: Pune
|
|
|
|
It seems that you want to shift data if there are spaces from pos 45 to 48.
If I am wrong then please correct me.
You can do it using SORT. Please use the following code:
Code: |
INREC FINDREP=(IN=C' ',OUT='',STARTPOS=45,ENDPOS=48)
SORT FIELDS=COPY
|
|
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
psriv20,
What do you want to replace SPACES with? Do you want to reduce LRECL incase you find spaces?
For Example, all 4 bytes are spaces and assuming your input LRECL is 80, do you want to reduce LRECL to 76 or do you need initialize with some numeric?
Thanks, |
|
Back to top |
|
|
psriv20 Currently Banned New User
Joined: 25 May 2009 Posts: 19 Location: Pune
|
|
|
|
Yes ... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you actually want help, suggest you answer questions completely. . .
Nonsense. . .
You were asked 2 seperate questions and a third with an or and the best you can do is "yes". . .
Post enough input records to show all of the possible cases and the output wanted from the sample input.
If anyone other than our IBMers post "solutions" before you provide the info, it will be deleted. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
I found it strange that the example removes spaces (non-numeric) and
replaces it with BBBB (also non-numeric)
Poor example? |
|
Back to top |
|
|
|