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
 

 

OMIT Spaces

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed Sep 16, 2009 11:50 am    Post subject: OMIT Spaces
Reply with quote

Hii all,

I am having an input file of LRECL = 80, FB. Please find a sample file below,
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
21524*#limited comp     *#1111*#abc comp ltd    *#O   *#6012
05555*#                 *#    *#New York         *#   *#   


I need the output like below,
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
21524*#limited comp*#1111*#abc comp ltd*#O*#6012
05555*#*#*#New York*#   


I used the sort
OPTION COPY
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))
and it is squeezing all the spaces.
But i need space between words like "abc comp ltd".

The logic i suppose is Omitting out the spaces present befor the symbol/delimiter "*#" in each field.
Please help me out if someone has sample code to accomplish this.

Note :- Dont know how may fields ll be there and the length of the fields might differ.
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Wed Sep 16, 2009 7:41 pm    Post subject:
Reply with quote

Hello,

You need to post the rule that determines which space(s) should be removed and which should be kept. . .
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 Sep 16, 2009 9:33 pm    Post subject:
Reply with quote

Niki,

I believe a DFSORT job like the following will do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
21524*#limited comp     *#1111*#abc comp ltd    *#O   *#6012
05555*#                 *#    *#New York        *#    *#
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
    BUILD=(1,5,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=7),X,
           7,18,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=20),X,
          26,5,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=7),X,
          32,17,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=19),X,
          50,5,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=7),X,
          56,10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=12),
          80:X)),
    IFTHEN=(WHEN=INIT,
      BUILD=(1,80,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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts Join and Omit records- Master File no... shajeeth DFSORT/ICETOOL 5 Tue Jan 26, 2016 8:16 pm
No new posts Remove intermediate spaces Pallavi Vishwanath SYNCSORT 1 Fri Jan 15, 2016 2:45 am


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