Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Network:
Windows 2008 Server
>Hi Gang!
>
>Anyone know a little Cobol?
>
>I have to send some data in a text file to another site, and they gave me a layout for the data they want. They use Cobol picture clauses to tell how they want the data items expressed.
>
>I have a problem in how to express negative currency amounts....
>
>Here is an example...
>
>PAYMENT AMOUNT PICT S9(07)V9(02)
>
>I can see an amount like $123.45 being 000012345 (the left seven being 0000123 and the right two being 45).
>
>But how do I express -$123.45 ?? Since I can't put the - in the string at all, since it wants only numeric values......
>
>Thanks!
My COBOL is a little (a lot) rusty, but if it still works the same way it used to work on mainframes, the last 4 bits indicate the sign. C is positive, D is negative, and F is unsigned (and I think treated as positive).
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement