Sysdate inside awk print statement

Hi,

I am using awk statement to extract data from a file and write a new file with certain columns rearranged and few hard coded values added to new file.

Now i need to add a column with sysdate. can i do that inside the awk print statement?

Now:

nawk ' /^3/ BEGIN {FS=","} {print("5",$1,$28,"$27",$26)}' $FILENAME >> newfile

Expected: sydate to be included, at the same time i have planned to use printf to make sure for proper padding of spaces

nawk ' /^3/ BEGIN {FS=","} {print("5","syadate"$1,$28,"$27",$26)}' $FILENAME >> newfile 

Help me out with a few suggestions

See if you can use this inside your code :

awk -v sysdate=$(date "+%Y%d%m") ' { print sysdate } '

gawk has the function called strftime

 
gawk 'BEGIN{print strftime("%y_%m_%d_%H_%M_%S")}'