IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Want to remove the space from a file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
psriv20
Currently Banned

New User


Joined: 25 May 2009
Posts: 19
Location: Pune

PostPosted: Mon Sep 27, 2010 5:58 pm
Reply with quote

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
View user's profile Send private message
prahalad

New User


Joined: 14 Sep 2010
Posts: 18
Location: Pune

PostPosted: Mon Sep 27, 2010 7:07 pm
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Mon Sep 27, 2010 7:22 pm
Reply with quote

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
View user's profile Send private message
psriv20
Currently Banned

New User


Joined: 25 May 2009
Posts: 19
Location: Pune

PostPosted: Mon Sep 27, 2010 9:02 pm
Reply with quote

Yes ...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Sep 27, 2010 9:52 pm
Reply with quote

Hello,

If you actually want help, suggest you answer questions completely. . .

Quote:
Yes ...
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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Mon Sep 27, 2010 11:27 pm
Reply with quote

I found it strange that the example removes spaces (non-numeric) and
replaces it with BBBB (also non-numeric)

Poor example?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top