sort card to add zeros to varying alphanumeric field.



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

sort card to add zeros to varying alphanumeric field.

Postby longfall » Thu Mar 09, 2023 12:03 am

Hi All,

I am trying to pull data from a file with delimiter (;).
I could achieve this by using-
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=8),%02=(FIXLEN=10)),
BUILD=(%00,%02)

Input-
X1234567;08/03/2023

Output-
X123456708/03/2023

Now I need to add, preceding zero to the first column, to make it of length 16-
for this I tried using
BUILD=(%00,UFF,M11,LENGTH=16,%02)
But as its alphanumeric filed the first byte is ignored-

Input-
X1234567;08/03/2023
X124123;08/03/2023

Output-
000000000123456708/03/2023
000000000012412308/03/2023

Exptect output-
00000000X123456708/03/2023
000000000X12412308/03/2023

Can someone guide me on this?
longfall
 
Posts: 1
Joined: Wed Mar 08, 2023 11:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: sort card to add zeros to varying alphanumeric field.

Postby sergeyken » Thu Mar 09, 2023 2:04 am

PLEASE!!!!!!

Learn how to format your messages, to allow other to understand something

longfall wrote:Hi All,

I am trying to pull data from a file with delimiter (;).
I could achieve this by using-
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=8),%02=(FIXLEN=10)),
         BUILD=(%00,%02)


Input-
X1234567;08/03/2023


Output-
X123456708/03/2023


Now I need to add, preceding zero to the first column, to make it of length 16-
for this I tried using
        BUILD=(%00,UFF,M11,LENGTH=16,%02)

But as its alphanumeric filed the first byte is ignored-

Input-
X1234567;08/03/2023
X124123;08/03/2023
 

Output-
000000000123456708/03/2023
000000000012412308/03/2023
 

Exptect output-
00000000X123456708/03/2023
000000000X12412308/03/2023


Can someone guide me on this?


You need simple thing, like this
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=8),%02=(FIXLEN=10)),
      BUILD=(%00,JFY=(SHIFT=RIGHT,LENGTH=16,LEAD=C'000000000000'),
             %02)
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post