Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2285
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 Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
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

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us