Name: peterc Date: June 24, 2003 at 02:51:22 Pacific Subject: more DCL help OS: VMS alpha CPU/Ram: dont know
Comment:
Hia, thanks ME, I didnt know you could use ' like that. Ive got a few character strings that are decimal numbers, and I need to add and multiply them together, leaving a resulting character string which is to become part of the ouput-file name. when I try to add them using f$string or f$integer the result is zero. What am I doing wrong? Cheers.
Hi, Thanks again ME, the solution you gave me is great, unfortunately the numbers I want to extract from a string have decimal places, so it obviously breaks down when I call F$INTEGER. Any ideas? cheers.
If you really intend on doing decimal math using DCL, you are probably going to have to write an extensive DCL command file to accomplish it. It would be lots easier to read the datafile using a C program or somesuch, but if you need to use DCL, try F$LOCATE() to get an index to the decimal point, then use F$LENGTH() and F$EXTRACT() to pull out the integer portion to the left of '.' and the integer portion to the right of the '.', then perform the math and put it back together. I hope this helps.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE