conversion of data
GCC Consulting
gcc at optonline.net
Fri Aug 13 13:57:06 PDT 2004
> -----Original Message-----
> From: filepro-list-bounces at lists.celestial.com
> [mailto:filepro-list-bounces at lists.celestial.com] On Behalf
> Of Rod Caddy
> Sent: Friday, August 13, 2004 4:16 PM
> To: filepro-list at lists.celestial.com
> Subject: conversion of data
>
> I am not sure that I really know how to ask this question. I
> need to be able to look at the value of the data in a field
> and pad another field with the number of zeros that the data tells me.
>
> Example:
>
> In a control file a 1 digit field is set to only allow the
> numbers 1-8.
> Whatever the number is I will take and pad another field with
> that number of zeros minus the number of characters that my
> starting number takes up.
>
> Control file has 6 in it.
> My starting number is 10.
> My math would be 6-2=4.
> My ending number would be 000010.
>
> I can test for this and have a long drawn out process but I
> was trying to shorten this. Any Ideas would be appreciated.
>
Since you haven't said how many characters your number is:
if:
Then: n=xx{"" xx=field # of value
if:
Then: nl=dlen(n) 'give you the display length
if: 'do lookup using what ever parameters you use
then: lookup controlfile .......
If:
Then:ct=lookup(ff)-nl;
Loop if: ct gt "0"
Then: n= ""{"0"{n;ct=ct-"1";GOTO loop
if:
then: xx=n;write;END
Richard Kreiss
GCC Consulting
More information about the Filepro-list
mailing list