Groups | Search | Server Info | Login | Register


Groups > comp.lang.cobol > #12886

Using one 01 in another 01?

From "Bruce M. Axtens" <some.one@some.where>
Newsgroups comp.lang.cobol
Subject Using one 01 in another 01?
Date 2025-02-04 03:17 +0000
Organization A noiseless patient Spider
Message-ID <vns0so$1j4ho$1@dont-email.me> (permalink)

Show all headers | View raw


Given

       IDENTIFICATION DIVISION.
       PROGRAM-ID. rotational-cipher.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 WS-KEY PIC 9(2).
       01 WS-TEXT PIC X(128).
       01 WS-CIPHER PIC X(128).
       01 WS-ALPHA-LOWER PIC X(26) VALUE 'abcdefghijklmnopqrstuvwxyz'.
       01 WS-ALPHA-UPPER PIC X(26) VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
       01 WS-DOUBLE-UPPER PIC X(52) 
        VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'.

       PROCEDURE DIVISION.
       ROTATIONAL-CIPHER.
        INITIALIZE WS-CIPHER.
        INSPECT WS-TEXT CONVERTING WS-ALPHA-LOWER TO WS-ALPHA-UPPER.
        ADD 1 TO WS-KEY.
        INSPECT WS-TEXT CONVERTING WS-ALPHA-UPPER TO 
          WS-DOUBLE-UPPER(WS-KEY:26).
        MOVE WS-TEXT TO WS-CIPHER.

is it possible to use WS-ALPHA-UPPER in WS-DOUBLE-UPPER by making WS-
DOUBLE-UPPER an 01 with a couple of 03 FILLERs with WS-ALPHA-UPPER as the 
values?

-Bruce

Back to comp.lang.cobol | Previous | NextNext in thread | Find similar


Thread

Using one 01 in another 01? "Bruce M. Axtens" <some.one@some.where> - 2025-02-04 03:17 +0000
  Re: Using one 01 in another 01? docdwarf@panix.com () - 2025-02-04 04:20 +0000
    Re: Using one 01 in another 01? Bruce Axtens <snetxa@hotmail.com> - 2025-02-05 21:54 +0800
      Re: Using one 01 in another 01? docdwarf@panix.com () - 2025-02-05 18:51 +0000

csiph-web