Generating dynamic variables

Hi ,

i am unable to generate dynamic variables can any one please help me on the below issue

 
j=1
{record_count_"$j"}=`db2 -xselect substr\(job_name,24\) rec_count from $libname.audit_table_nrt where job_name like \'DATAMART_DEL_RUN%\' and STS_FLAG=\'E\' and seq_no=$i`
echo " record count == ${record_count_$j}"
j=$j+1
i=$i-1

in the above scenario i have to write values in to record_count_1,record_count_2 ... variables

can some one guide is it correct syntax or not

and ${record_count_$j} this also showing error

Thanks in advance
Vijay

record_count_${j}=`db2 -xselect substr\(job_name,24\) rec_count from $libname.audit_table_nrt where job_name like \'DATAMART_DEL_RUN%\' and STS_FLAG=\'E\' and seq_no=$i`
j=$((j + 1))

Thanks alot it works fine now

---------- Post updated at 01:20 PM ---------- Previous update was at 11:10 AM ----------

HI

I am unable to print the value

echo " record count == ${record_count_$j}"

can some one help me on this

Regards
vijay

Use the below

eval echo " record count == \${record_count_$j}"