MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

removing intermediate spaces in the records of a file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
priyaranjan.mishra
Beginner


Joined: 21 Jan 2008
Posts: 17
Topics: 9

PostPosted: Thu Nov 19, 2009 4:39 am    Post subject: removing intermediate spaces in the records of a file Reply with quote

I have to remove intermediate spaces in the records ofa file and insert coma in between.
For example:
I/P:
1234 5678
00000 2222
10 25

O/P:
1234,5678
00000,2222
10,25
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Nov 19, 2009 6:40 am    Post subject: Reply with quote

What do you expect to see if there are two or more consecutive spaces within a record
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Nov 19, 2009 10:43 am    Post subject: Reply with quote

priyaranjan.mishra,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                               
1234 5678                                     
00000 2222                                     
10 25                                         
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                               
  SORT FIELDS=COPY                             
  INREC BUILD=(1,80,SQZ=(SHIFT=LEFT,MID=C','))
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group