Page 1 of 1
Level 49 and VARCHAR?
Posted: Mon Jan 16, 2023 11:27 pm
by RaGa
Hi,
Is there a reason that Level 49 is used only for DB2? Why can't we use it for anything else? Is there a reason?
Thanks for any answers and literature about it.
Re: Level 49 and VARCHAR?
Posted: Tue Jan 17, 2023 12:44 am
by Robert Sample
Whoever told you that level 49 is exclusively for DB2 -- you need to stop listening to that person and find an actual COBOL expert. Level 49 can be used by any program:
Code: Select all
000001 000100 IDENTIFICATION DIVISION.
000002 000200 PROGRAM-ID. MF0063.
000003 000300 ENVIRONMENT DIVISION.
000004 000400 CONFIGURATION SECTION.
000005 000500 OBJECT-COMPUTER. IBM-370.
000006 000600 SOURCE-COMPUTER. IBM-370.
000007 000700 DATA DIVISION.
000008 000800 WORKING-STORAGE SECTION.
000009 000900 01 WS-AREA. 000000000 0CL9
000010 001000 49 WS-49-LEVEL PIC 9(09) VALUE ZERO. 000000000 9C
IMP
000011 001800 PROCEDURE DIVISION.
000012 002000 DISPLAY '>' WS-49-LEVEL '<'. 10
000013 002400 STOP RUN.
P 5655-EC6 IBM Enterprise COBOL for z/OS 6.3.0 P211108 MF0063 Date 01/16/2023 Time 13:08:23 Page 4
n "M" preceding a data-name reference indicates that the data-name is modified by this reference.
gives results of
Code: Select all
***********
>000000000<
***********
So your question about why you can't use it for anything else is based on a false premise and hence makes no sense.