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
 

 

Omitting 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 Apr 01, 2009 10:53 am    Post subject: Omitting Spaces
Reply with quote

Hi all,

I am having an input file of lrecl = 80 like below,

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
123 sskla     yhrt ksldjk
1595 sdaj    jsdl;o      jkjkk   


So my output ( lrecl = 80, FB) should look like below,

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
123 sskla yhrt ksldjk
1595 sdaj jsdl;o jkjkk   


The codition is,

--> If at any point of time, there are more than one space is present in the file then it should be omitted and the character other than space in the record should be append in the record.
Back to top
View user's profile Send private message

Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed Apr 01, 2009 12:11 pm    Post subject:
Reply with quote

Hi,

I used the below code
Code:

//TOOLIN DD *                                   
   COPY FROM(SORTIN) TO(SORTOUT) USING(CTL1)     
/*                                               
//*                                             
//CTL1CNTL DD *                                 
   OPTION COPY                                   
   INREC BUILD=(1,1000,SQZ=(SHIFT=LEFT,MID=C' '))
/*                                               


and got the output.

But let my input file is having 100 records and i want to perform the squeeze of spaces after 10 records. That means startting from record number 11 to 100 i ned to perfrm this.

Can anyone please guide me hw to achieve this ???
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed Apr 01, 2009 2:34 pm    Post subject:
Reply with quote

I suppose i was not clear with my question.

My actual requirement is like below.
Let the below is my input file, ( Lrecl = 80 )

Code:

       212545 576 kfjklasjd 875 kajsld
asda asdas a 545 5545
   asda sda 454 2542 dfffgg
123 456    lkdakl   4558asdas  5655aaa
558736   553 354 jlajd  jhkj   jahjksda kll


And i need the output like,

Code:

       212545 576 kfjklasjd 875 kajsld
asda asdas a 545 5545
   asda sda 454 2542 dfffgg
123 456 lkdakl 4558asdas 5655aaa
558736 553 354 jlajd jhkj jahjksda kll



So when i use the below code,

INREC BUILD=(1,80,SQZ=(SHIFT=LEFT,MID=C' '))
I am getting the output like,

Code:

123 456 lkdakl 4558asdas 5655aaa
558736 553 354 jlajd jhkj jahjksda kll
212545 576 kfjklasjd 875 kajsld
asda asdas a 545 5545
asda sda 454 2542 dfffgg


So what i tought is lets skip the first 3 records and then will do the copy operation on the rest of the records and ultimately i ll get the output.

If i ll use the code like,
INREC BUILD=(5,80,SQZ=(SHIFT=LEFT,MID=C' '))

Then the output is coming like below,

Code:

56 lkdakl 4558asdas 5655aaa
6 553 354 jlajd jhkj jahjksda kll
5 576 kfjklasjd 875 kajsld
asdas a 545 5545
sda 454 2542 dfffgg


Is there any other method to squeeze the spaces which will come after that is coming between two values means if the record starts with a space then it should not squeeze the first ones but later it can. For e.g

INPUT
Code:

      12345     sad dasd     5774
asda sadad    sdasd    asdad   asda


OutPut
Code:

      12345 sad dasd 5774
asda sadad sdasd asdad asda
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Apr 01, 2009 3:25 pm    Post subject:
Reply with quote

This seems to work for me....
Code:
//S001     EXEC PGM=ICEMAN                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
       212545 576 kfjklasjd 875 kajsld                   
asda asdas a 545 5545                                     
   asda sda 454 2542 dfffgg                               
123 456    lkdakl   4558asdas  5655aaa                   
558736   553 354 jlajd  jhkj   jahjksda kll               
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  OPTION COPY                                             
  INREC IFTHEN=(WHEN=(1,1,CH,NE,C' '),                   
      BUILD=(1,80,SQZ=(SHIFT=LEFT,MID=C' ')))   
/*                                                       
//                                                       


output is
Code:

       212545 576 kfjklasjd 875 kajsld   
asda asdas a 545 5545                   
   asda sda 454 2542 dfffgg             
123 456 lkdakl 4558asdas 5655aaa         
558736 553 354 jlajd jhkj jahjksda kll   

Garry.
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed Apr 01, 2009 4:08 pm    Post subject:
Reply with quote

Hi Garry,

Thank you very much for the help.
I got my output.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Apr 01, 2009 4:33 pm    Post subject:
Reply with quote

Glad to have been of help. Thanks for letting us know.

Garry.
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 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


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