Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,870 questions

51,793 answers

573 users

How to initialize variables in COBOL

1 Answer

0 votes
IDENTIFICATION DIVISION.
PROGRAM-ID. COBOL-PRO.

DATA DIVISION.
   WORKING-STORAGE SECTION.
   01 A-NUM1 PIC 99V99 VALUE IS 3.14.
   01 A-S PIC A(5) VALUE 'cobol'.
   01 A-VAL PIC 99 VALUE ZERO.
   01 A-NUM2 PIC S9(1)V9(2) VALUE -3.14.

PROCEDURE DIVISION.
   DISPLAY "A-NUM1 : "A-NUM1.
   DISPLAY "A-S : "A-S.
   DISPLAY "A-VAL : "A-VAL.
   DISPLAY "A-NUM2 : "A-NUM2.
STOP RUN.



# run:
#
# A-NUM1 : 03.14
# A-S : cobol
# A-VAL : 00
# A-NUM2 : -3.14

 



answered Sep 17, 2020 by avibootz

Related questions

1 answer 98 views
2 answers 587 views
587 views asked Sep 18, 2020 by avibootz
2 answers 290 views
290 views asked Sep 18, 2020 by avibootz
2 answers 330 views
330 views asked Sep 17, 2020 by avibootz
2 answers 319 views
319 views asked Sep 17, 2020 by avibootz
1 answer 260 views
260 views asked Sep 17, 2020 by avibootz
1 answer 68 views
...