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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Wed Feb 24, 2010 5:46 pm
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
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 Developer


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

PostPosted: Fri Feb 26, 2010 2:24 am
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
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: 1702
Location: Australia

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

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

DFSORT Developer


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

PostPosted: Wed Mar 03, 2010 11:47 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Remove leading zeroes SYNCSORT 4
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Cobol program with sequence number ra... COBOL Programming 5
Search our Forums:

Back to Top