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 *
Loaded 29123 rows into the database
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
INREC PARSE=(%01=(ABSPOS=8,ENDBEFR=C' ',FIXLEN=10)),
For the example give, SORTOUT would have:
For an input record of:
Loaded 29 rows into the database
SORTOUT would have:
and so on.
You can change this job appropriately for what you want to do.