subasu,
You can use a DFSORT job like the following to write a record with the extracted number as 10 digits with leading zeros. I assumed your largest number is 10 digits but you can change that if appropriate.
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
... record
... record
Loaded 29123 rows into the database
... record
... record
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,6,CH,EQ,C'Loaded')
INREC PARSE=(%01=(ABSPOS=8,ENDBEFR=C' ',FIXLEN=10)),
BUILD=(%01,UFF,M11,LENGTH=10,80:X)
/*
For the example give, SORTOUT would have:
0000029123
For an input record of:
Loaded 29 rows into the database
SORTOUT would have:
0000000029
and so on.
You can change this job appropriately for what you want to do.