ok what i need to do is to make a script function which allows me to change the records in a file. I read some other posts about using sed but i still could not get it to work. The function runs But nothing changes in my file.

This is what my file contains:
Name, Dept, Job, Pay

and my code:

function editInfo
read -p "Enter current info to edit: " oldInfo
read -p "Enter new info: " newInfo
sed -i 's/oldInfo/newInfo/g' "$dataFile"

> sed -i 's/oldInfo/newInfo/g' "$dataFile"
You need to watch your shell's quoting rules.
Things in single quotes are preserved as is
Things in double quotes allow $substitutions.

Perhaps then
sed -i "s/$oldInfo/$newInfo/g" "$dataFile"

Also, as Salem pointed out, don't forget to use the preceding $ character when you're extracting values from your variables.

Best wishes,