Page 1 of 1

sort card to add zeros to varying alphanumeric field.

PostPosted: Thu Mar 09, 2023 12:03 am
by longfall
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?

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

PostPosted: Thu Mar 09, 2023 2:04 am
by sergeyken
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)