View previous topic :: View next topic
|
Author |
Message |
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
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 |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
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 |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Hi Garry,
Thank you very much for the help.
I got my output. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Glad to have been of help. Thanks for letting us know.
Garry. |
|
Back to top |
|
|
|