Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

Excel field needs re-formatting when extracted by COBOL. Any cure?

$
0
0

We're now successfully using Visual COBOL to read data from Excel, which is a victory.  But we've got a problem. 

Here's relevant program code:

          working-storage section.

          01 excel-contents PIC X(13).
          01 excel-contents-num redefines excel-contents PIC S9(12).

          01 W-CELL-VALUE   PIC S9(12).

          procedure division.

          invoke Cell "getValue" returning excel-contents.

          MOVE excel-contents-num TO W-CELL-VALUE.

The problem:  example -- the Excel cell contains the 15

W-CELL-VALUE should be"000000000015"

instead, we're getting       "15          "

We could fix this with some kind of character-handling, but before we try that, is there something simple that we're overlooking?


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>