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

Omitting Spaces


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Wed Apr 01, 2009 10:53 am
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: 106
Location: Bangalore

PostPosted: Wed Apr 01, 2009 12:11 pm
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: 106
Location: Bangalore

PostPosted: Wed Apr 01, 2009 2:34 pm
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Apr 01, 2009 3:25 pm
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: 106
Location: Bangalore

PostPosted: Wed Apr 01, 2009 4:08 pm
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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Apr 01, 2009 4:33 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
No new posts How to remove spaces in between. SYNCSORT 12
No new posts File transfer from host with filler f... TSO/ISPF 15
Search our Forums:

Back to Top