Skip to content

Instantly share code, notes, and snippets.

@pdemby
Last active August 29, 2015 14:08
Show Gist options
  • Save pdemby/136d9415a872f1d20044 to your computer and use it in GitHub Desktop.
Save pdemby/136d9415a872f1d20044 to your computer and use it in GitHub Desktop.
move-3
IDENTIFICATION DIVISION.
PROGRAM-ID. TruncateNumber.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 BIG-NUMBER PIC 9(5).9(4).
01 LITTLE-NUMBER PIC 9(3).9(2).
PROCEDURE DIVISION.
TRUNCATE-ROUTINE.
MOVE 12345.6789 TO BIG-NUMBER.
MOVE BIG-NUMBER TO LITTLE-NUMBER.
DISPLAY "BIG-NUMBER = " BIG-NUMBER.
DISPLAY "LITTLE-NUMBER = " LITTLE-NUMBER.
STOP RUN.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment