Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Trim Leading & Trailing Spaces but leaving spaces b/t va

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Ramanan-R

New User


Joined: 21 Mar 2007
Posts: 66
Location: Chennai, Tamilnadu, India

PostPosted: Wed Feb 24, 2010 5:35 pm    Post subject: Trim Leading & Trailing Spaces but leaving spaces b/t va
Reply with quote

Hi All icon_smile.gif

I have a file (LRECL = 80) with three fields as below

Field_1: 1,15
Field_2: 16,10
Field_3: 26,5

Requirement:
1. Remove Leading and Trailing Spaces between fields,
2. Delimit Fields with Pipe (|),
3. Preserve spaces between Field values...

Example:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
  AAAA    BB    CCC  DD  EE FF


Expected Output:
Code:
AAAA    BB|CCC  DD|EE FF|


Thanks in advance!

Regards,
Ramanan R
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Wed Feb 24, 2010 5:46 pm    Post subject:
Reply with quote

Ramanan-R,

Which sort product do you use...? Your recent posts suggests that you have SyncSort.
Back to top
View user's profile Send private message
Ramanan-R

New User


Joined: 21 Mar 2007
Posts: 66
Location: Chennai, Tamilnadu, India

PostPosted: Wed Feb 24, 2010 9:07 pm    Post subject:
Reply with quote

Hi Arun...

Yes, our shop has Syncsort...

If possible, please also advise DFSORT/ICETOOL solution.. Just for my reference icon_biggrin.gif

Regards,
Ramanan R
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 26, 2010 2:24 am    Post subject:
Reply with quote

Quote:
If possible, please also advise DFSORT/ICETOOL solution.. Just for my reference


Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=80,
    IFTHEN=(WHEN=INIT,
     BUILD=(1,15,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=17),
      16,10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=12),
      26,5,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=7))),
    IFTHEN=(WHEN=INIT,
     BUILD=(1,36,SQZ=(SHIFT=LEFT,MID=C'|',PAIR=QUOTE))),
    IFTHEN=(WHEN=INIT,FINDREP=(IN=C'"',OUT=C''))
/*
Back to top
View user's profile Send private message
Ramanan-R

New User


Joined: 21 Mar 2007
Posts: 66
Location: Chennai, Tamilnadu, India

PostPosted: Wed Mar 03, 2010 12:43 pm    Post subject:
Reply with quote

Frank...

What to say!? I love you...
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Mar 03, 2010 3:14 pm    Post subject:
Reply with quote

you must love old blokes icon_lol.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Mar 03, 2010 11:47 pm    Post subject:
Reply with quote

Well, old blokes need love too. But I'm already spoken for (by my wife and four pet rats). icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Remove intermediate spaces Pallavi Vishwanath SYNCSORT 1 Fri Jan 15, 2016 2:45 am
No new posts Syncsort to remove the leading spaces V S Amarendra Reddy SYNCSORT 5 Fri Jan 08, 2016 9:47 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Jobs in Leading Indian MNC aman2248 Mainframe Jobs 0 Mon Dec 21, 2015 3:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us