i need to take a char variable to decimal. what i am doing is using scanning the field into the program but it can also be entered in manually. if entered in manually it will be in number format with zeros in front of it, but if i scan it may have a 'Q' in the field. i know that i can scan for a 'Q' and %subst the number portion back out of the field. so if my scan number is 000Q85 i can get the 85 out but when i go to move it to the number field it becomes 85000. i am currently using v5r1 software and writing this mostly in rpg free format.
thanks for all your help in advance.
don
here is the code using. or is there a way to iniz a variable to be any number but 0
result = *zeros;
reslt = *zeros;
qtytmp = qty1;
result = %scan('Q':qty1:1);
reslt = 7 - result;
qty = %dec(qty2: 6 : 0);
/end-free
c move(p) qty2 qty
/free
thanks for all your help in advance.
don
here is the code using. or is there a way to iniz a variable to be any number but 0
result = *zeros;
reslt = *zeros;
qtytmp = qty1;
result = %scan('Q':qty1:1);
reslt = 7 - result;
qty = %dec(qty2: 6 : 0);
/end-free
c move(p) qty2 qty
/free
Comment