How can I format amount of LEADING ZEROS in DISPLAY?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How can I format amount of LEADING ZEROS in DISPLAY?

Postby andrisole » Mon Nov 13, 2017 9:31 pm

Hi,

I am trying to make one exercise, which requires to me to make a report on different branches.

I need branches to have exactly 6 digits, in case if there is brach 123, it will be displayed as 000123.
What I am trying to do is to include leading zeros using LZ statement:
HEADER('SORTCODE') ON(1,4,BI,A0,LZ)
,

but it prints too many leading zeros, and I do not know how to remove extra ones.

   SORTCODE
-----------
 0000000000
 0000000001
 0000000012
 0000010101
 0000010203
 0000012017
 0000040101
 0000090909
 0000101010
 0000101101
 0000110695
 0000111111
 0000111112
 


Can anyone help please?
andrisole
 
Posts: 1
Joined: Mon Nov 13, 2017 7:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How can I format amount of LEADING ZEROS in DISPLAY?

Postby Aki88 » Fri Feb 09, 2018 11:11 pm

Hello,

Unsure if this is resolved, in case it still isn't, look at the usage of EDIT mask under the DISPLAY operator that you are using.
You can use a mask: E'999999'; the edit mask should give you the desired output as you've restricted the data to 6 bytes in the mask.
Else use a simple BUILD command with the desired EDIT pattern.
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post