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

Suppressing only leading zeros (not spaces)


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Sebin89

New User


Joined: 14 Dec 2020
Posts: 10
Location: Germany

PostPosted: Fri Mar 12, 2021 12:26 am
Reply with quote

I was trying to suppress the leading zeros of a file using ICETOOL. but it is also removing spaces in that file. Could you please help me to modify control statement to get the expected output?

INPUT:
Code:

=COLS> ----+----1----+----2
****** ********************
000001 0000/0000000123  123
000002 0000/0000001234  123
000003 0000/0000012345  123
000004 0000/0000123456  123


OUTPUT:
Code:

=COLS> ----+----1----+----2
****** *********************
000001 0000/123123         
000002 0000/1234123         
000003 0000/12345123         
000004 0000/123456123


CNTL Used:
Code:

INREC  BUILD=(1,5,06,15,UFF)         
OUTFIL FNAMES=COP1OUT,               
       BUILD=(                       
             1,4,                   
             C'/',                   
             6,15,SQZ=(SHIFT=LEFT)) 
END                                 


expected output:
Code:

=COLS> ----+----1----+----2
****** *********************
000001 0000/123  123         
000002 0000/1234  123         
000003 0000/12345  123         
000004 0000/123456  123
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Fri Mar 12, 2021 1:00 am
Reply with quote

1) reformat the first column using
Code:
 BUILD=(...,6,10,ZD,EDIT=(IIIIIIIIIT),...)

2) use JFY (not SQZ) to move left
Code:
 BUILD=(...,6,15,JFY=(SHIFT=LEFT),...)


It’s up to you: to decide how to do two conversions in one single pass. Several ways are possible.
Back to top
View user's profile Send private message
Sebin89

New User


Joined: 14 Dec 2020
Posts: 10
Location: Germany

PostPosted: Fri Mar 12, 2021 1:53 am
Reply with quote

many thanks for the hint.

Used CNTL:
Code:

INREC  BUILD=(1,5,6,10,ZD,EDIT=(IIIIIIIIIT),16,5)
OUTFIL FNAMES=COP1OUT,                           
       BUILD=(                                   
             1,4,                               
             C'/',                               
             6,15,JFY=(SHIFT=LEFT))             
END                                             
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1245
Location: Bamberg, Germany

PostPosted: Fri Mar 12, 2021 3:41 am
Reply with quote

Instead of EDIT=() as suggested by sergeyken, you can also use predefined Edit Mask Patterns. In this case this would be M10. Just saying.
Back to top
View user's profile Send private message
Sebin89

New User


Joined: 14 Dec 2020
Posts: 10
Location: Germany

PostPosted: Fri Mar 12, 2021 4:01 pm
Reply with quote

Many thanks for the suggestions. Both are working for me.
Just in curiosity; Could you please explain the working of below statements?

Code:

 BUILD=(...,6,10,ZD,EDIT=(IIIIIIIIIT),...)
What is ZD and EDIT=(IIIIIIIIIT) do here?

Code:

JFY=(SHIFT=LEFT)
What is the significant of JFY here?

Code:

M10
What changes is M10 making here?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Mar 12, 2021 5:00 pm
Reply with quote

This topic has been discussed so many times on Beginners and this forum , please try searching the forum before posting and that will save duplicate posts and time.
e.g. ibmmainframes.com/about62013.html

Your questions requires reading the manuals and not just for what you have asked but for everything else how DFSORT works. This will help you to understand the concepts of DFSORT product and helpful for long term .
e.g. www.ibm.com/support/knowledgecenter/SSLTBW_2.4.0/com.ibm.zos.v2r4.iceg200/enf.htm
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Fri Mar 12, 2021 6:19 pm
Reply with quote

Sebin89 wrote:
Many thanks for the suggestions. Both are working for me.
Just in curiosity; Could you please explain the working of below statements?

Code:

 BUILD=(...,6,10,ZD,EDIT=(IIIIIIIIIT),...)
What is ZD and EDIT=(IIIIIIIIIT) do here?

Code:

JFY=(SHIFT=LEFT)
What is the significant of JFY here?

Code:

M10
What changes is M10 making here?


Shame on those who are not able to read technical manuals, even after receiving detailed hints.
The thing happened which I was afraid of: you have copied-and-pasted the given solution, without a minor attempt to understand it.
Sorry, but this is a trained monkey's behavior.
36_8_9.gif icon_pray.gif 12.gif
Back to top
View user's profile Send private message
Sebin89

New User


Joined: 14 Dec 2020
Posts: 10
Location: Germany

PostPosted: Sat Mar 13, 2021 2:41 am
Reply with quote

many thanks for all the help and links. as a beginner its really helping me.

sergeyken, it is not about copy and paste or something. it is all about learning. as someone says there is no stupid questions only stupid answers. small hints, links etc do a lot for beginner.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1245
Location: Bamberg, Germany

PostPosted: Sat Mar 13, 2021 3:06 am
Reply with quote

Sebin89 wrote:
many thanks for all the help and links. as a beginner its really helping me.

See also https://www.ibmmainframeforum.com - Mainframe Tech Help Forum for Beginners. icon_eek.gif
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Sat Mar 13, 2021 4:10 am
Reply with quote

Sebin89 wrote:
many thanks for all the help and links. as a beginner its really helping me.

sergeyken, it is not about copy and paste or something. it is all about learning. as someone says there is no stupid questions only stupid answers. small hints, links etc do a lot for beginner.

You are given particular examples of control statements.
Next, it should be your responsibility to find detailed description of those statements, and parameters from any of available manuals, and to understand: why these particular solutions suggested, and how they work.
If one cannot do this simple task, that demonstrates his inability to understand technical literature, also to perform his further tasks, requiring a little more thinking with his own mind.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
Search our Forums:

Back to Top