IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is there auto-initialization in Cobol390.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Apr 23, 2009 12:01 pm
Reply with quote

Hi GUYz,

My friend is working in a COBOL-CONVERSION project(COBOL2 to COBOL390). This is how the process goes.
Run the COBOL2 program, get the output in a dataset file.
Convert COBOL2 into COBOL390.
Run the COBOL390 program, get the output in a different dataset file.
Compare the both the outputs, it should be same.


After converting one of the program and comparing the output. There was junk character found in COBOL2 output, after each execution of the cobol2 program the junk character happens to be different like B or 2.... In cobol390, its just spaces, no junk characters.

He had put the program in the CA-intertest and he checked. When the file is opened in the output mode he is getting the junk character. Following is the sequence of jumps the program takes.

Before opening the files CONTROL-REPORT has few junk characters that he saw in the intertest like
Code:
"."0.".0.................
..E6...................fy
.................. ......
..&..........-...........
...................


After opening the file
Code:
... .....................
.........................
.........................
.........................
...................


In the second run after opening the file
Code:
..K .....................
.........................
.........................
.........................
...................



This is some parts of the code.

The declaration
Code:
FD  LPBCTL02-CONTROL-REPORT                     
    RECORDING MODE IS F                         
    BLOCK CONTAINS 0 RECORDS                   
    LABEL RECORDS ARE STANDARD                 
    RECORD CONTAINS 133 CHARACTERS             
    DATA RECORD IS CONTROL-REPORT.             
                                               
01  CONTROL-REPORT             PIC X(133).     


Code:
PERFORM OPEN-FILES THRU OPEN-FILES-EXIT. 


Code:
OPEN-FILES.                                   
                                               
    OPEN OUTPUT LPBCTL01-TRANS-REPORT         
                LPBCTL02-CONTROL-REPORT       
                OPBCTL01-C510-PARM-CARDS.     
                                               


So, i was wondering. Does all the variables get auto-initialized in COBOL390.
Then i came across the following LINk

So, after reading the post. It can be also be a compiler setting for auto-initialization.

How can i check it in the compiler listing?
Does this particular setting have a name in COBOL2 & COBOL390 ?

Thank YOU,
Sushanth
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 23, 2009 4:08 pm
Reply with quote

STORAGE controls the initial content of storage when allocated and freed.

The run-time options in effect at the time the routine is run can affect routine behavior. Use RPTOPTS(ON) to generate an options report in the Language Environment message file when your routine terminates. The options report lists run-time options, and indicates where they were set.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Apr 23, 2009 5:22 pm
Reply with quote

Thank You CICS guy, that was very informational. I just got to know that COBOL390 is ENTERPRISE COBOL. I don't know why they are calling it COBOL390 conversion.

My friends case, Since the output files are not matching between COBOL2 & Enterprise COBOL. My friend is not able move set of programs with cases like this to production. I think, this is because of the person who has programmed in COBOL2 has not initialized the variable(didn't use INITIALIZE in cobol2), somehow the variables are getting initialized in Enterprise COBOL. Difference in outputs.

Thing with the COBOL CONVERION their project is, it has to be CONVERSION not CORRECTION.

Thank You,
Sushanth
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 23, 2009 5:27 pm
Reply with quote

LE can also initialize storage -- although the particular pattern seen in the post is suspect; one byte wouldn't typically be changed (it's generally all or nothing).
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Apr 23, 2009 6:37 pm
Reply with quote

Robert,

Can i know, what is LE ?

Thank You,
Sushanth
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 23, 2009 6:40 pm
Reply with quote

LE = Language Environment
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Apr 23, 2009 7:05 pm
Reply with quote

Language Environment can also initialize storage ?
Is the LE here being reffered to mainframe.


Sushanth
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 23, 2009 7:16 pm
Reply with quote

LE is the term coined by IBM to define a set of services and subroutines
whose objective was to provide common services to all the languages supported by z/OS

once upon a time there was a COBOL library, a PL/1 library , ...
each language had it' s own set of service routines

the LE environment is meant to provide and unify these services in order to yield consistent results for any language involved

see for documentation al the CEE.... functions
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Apr 23, 2009 7:21 pm
Reply with quote

Thank You Enrico
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 23, 2009 7:24 pm
Reply with quote

Language Environment is an IBM-specific cross-language support platform that runs on the mainframe (it may run other places, too, but I don't deal with them -- only z/Architecture boxes). The Enterprise COBOL Migration Guide has extensive material on moving from VS COBOL II to Enterprise COBOL and LE. The LE manual discusses run time storage initialization:
Quote:
2.2.2.50 STORAGE

STORAGE controls the initial content of storage when allocated and freed. It also controls the amount of storage that is reserved for the out-of-storage condition. If you specify one of the parameters in the STORAGE run-time option, all allocated storage processed by that parameter is initialized to the specified value. Otherwise, it is left uninitialized.

You can use the STORAGE option to identify uninitialized application variables, or prevent the accidental use of previously freed storage. STORAGE is also useful in data security. For example, storage containing sensitive data can be cleared when it is freed.

Non-CICS Default: STORAGE=((NONE,NONE,NONE,0K),OVR)

CICS Default: STORAGE=((NONE,NONE,NONE,0K),OVR)

AMODE 64Default: STORAGE=((NONE,NONE,NONE,),OVR)
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Apr 23, 2009 7:29 pm
Reply with quote

Hello Guyz,

Quote:
If you specify one of the parameters in the STORAGE run-time option, all allocated storage processed by that parameter is initialized to the specified value. Otherwise, it is left uninitialized.


Is there a way to check this, has the STORAGE parameter been specified in the LE settings ?

Just viewing it fine?

Thank You,
Sushanth
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 23, 2009 7:35 pm
Reply with quote

Use RPTOPTS(ON) to get a report on the LE options specified. If you're running a batch job,
Code:
 PARM='RPTOPTS(ON)/'
should do nicely. Or you may want to look at
Code:
PARM='RPTOPTS(ON),RPTSTG(ON)/'
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Apr 23, 2009 7:52 pm
Reply with quote

Hello guyz,

THis is the job we use in our shop to compile,link-edit & bind. This is a LMF(Library Management Facility) job.
The program name here is DB2mulse & link name is LB2MULSE.

I gave that command along with other parameters. The JOB was successfull. But, i couldn't find infomation about LE, anywhere in SPOOL message.

Code:
//HXSULLXX JOB (T,TEST),'HXSULL',MSGCLASS=X,CLASS=L,NOTIFY=HXSULL 
//*****************************************************************
//LMFBTCH EXEC PGM=BZLBTCH,REGION=4096K,                           
// PARM=('M=DB2MULSE,IH,NLV0,A,C,SOURCE,LB2MULSE, ',               
//       'N, ','RPTOPTS(ON)/')                                     
//STEPLIB   DD  DSN=PLT.POPR.DEVL.LOADLIB,DISP=SHR                 
//          DD  DSN=LMF.LOADB,DISP=SHR                             
//LSTIN    DD SYSOUT=*,DCB=(LRECL=121,BLKSIZE=2420,RECFM=FBA)     
//LST133   DD SYSOUT=*,DCB=(LRECL=133,BLKSIZE=2660,RECFM=FBA)     
//INPUT  DD  UNIT=VIO,SPACE=(CYL,(2,8)),DISP=(MOD,DELETE),         
//  DCB=(RECFM=FBA,LRECL=121,BLKSIZE=2420)                         
//DBRMLIB  DD DSN=TNLV0.TEST.DBRMHOLD,DISP=SHR                     


Thank You,
Sushanth
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 23, 2009 8:07 pm
Reply with quote

Sushanth,

the 'parm' should be a part of the JCL that invokes the COBOL program.

has nothing to do with the compile/link steps.

and would suggest looking at the LE intro guide (part of each of the language references).
in the newer ops-systems (z/os) ,
not knowing something about LE
is like not knowing about Hex.

Running old garbage
(cobol written without respect to IBM guidelines)
LE will bit you on the ass.
some programs will not run the same (if at all) in the new environment.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 23, 2009 8:17 pm
Reply with quote

Code:
// PARM=('RPTOPTS(ON)/M=DB2MULSE,IH,NLV0,A,C,SOURCE,LB2MULSE, ',               
//       'N, ')                         
or something similar will be required. With LE, the PARM= has the LE values followed by a slash followed by the program specific parameters.

Further, as Dick pointed out, putting this in the compile / linkage job does not tell you about the run time environment -- only putting the parameter in the run job will give you the run time environment details.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Apr 24, 2009 2:21 pm
Reply with quote

Hello,

Following is my RUN JOB
Code:
//HXSULLXX JOB (T,TEST),'RUN PROG',MSGCLASS=X,CLASS=L,NOTIFY=&SYSUID   
//*********************************************************************
//*       JCL TO EXECUTE PROGRAM                                      *
//*********************************************************************
//RUNPROGR EXEC PGM=IKJEFT01,                                         
// PARM=('RPTOPTS(ON)')                                               
//*********************************************************************
//STEPLIB  DD DSN=TNLV0.TEST.LOADB,DISP=SHR                           
//         DD DSN=PNLV0.PROD.LOADB,DISP=SHR                           
//*FILE1    DD DSN=TNLV0.TEST.OBJLIB,DISP=SHR                         
//*FILE2    DD DSN=NLV0.DLMF.LOAD.HXSULL                               
//SYSUDUMP DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//OUTDD    DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSTSIN  DD *                                                       
  DSN SYSTEM (DB2D)                                                   
  RUN PROGRAM (DB2MULSE) PLAN(BOBPLAN)                                 


in the SYSTSPRT "invalid comand name syntax" message came
Code:
INVALID COMMAND NAME SYNTAX                       
READY                                             
  DSN SYSTEM (DB2D)                               
DSN                                               
  RUN PROGRAM (DB2MULSE) PLAN(BOBPLAN)             
DSN                                               
  END                                             
READY                                             
END               


So, i must be missing something here.


Thank You,

Sushanth
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 24, 2009 3:25 pm
Reply with quote

You probably need to put the PARM on the RUN PROGRAM statement, not the EXEC PGM=IKJEFT01. Or you can add to your JCL:
Code:
//CEEOPTS DD *
RPTSTG(ON)
/*
However, we don't run DB2 here so I can't test to verify this.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Apr 24, 2009 4:36 pm
Reply with quote

Thank You Robert, It works.

I have changed the option to
Code:
//CEEOPTS   DD *
RPTOPTS(ON)     
/*

Iam getting values like in this LINK

My STORAGE(NONE,NONE,NONE,8192) values and only the reserve size is specified. Heap and Stack are not initialized.

Since, my friend and i are working in the same place.
So, the settings must me same for COBOL2 & Enterprise COBOL, right ? It must have the same storage values right.


Sushanth
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 24, 2009 4:47 pm
Reply with quote

No, the settings don't have to be the same for COBOL II and Enterprise COBOL -- when installing the language there is a step to allow specific LE options to be compiled for that language; CEEUOPTS may be the name (it has been a while since I installed COBOL) -- I remember CEEDOPTS is the site wide options.

Working at the same place doesn't guarantee the same options, either -- you could be working on different LPARs (each of which may have different LE options) or even on different machines (which could be running different versions of the operating system much less LE).

IIRC, there was a WSCLEAR option in COBOL II that initialized storage -- check the COBOL II compile options to see if it was specified. If so, you can mimic the behavior by using LE option STORAGE=(00,NONE,NONE,8K) at run time.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 24, 2009 4:48 pm
Reply with quote

Glad to hear you got the options listed -- now if we can just resolve the original issue it'll be a good Friday!
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Apr 24, 2009 4:59 pm
Reply with quote

Robert is correct. WSCLEAR was added to COBOL2 (version 4 IIRC) due to the fact that it no longer received pre-initialised storage as was in OS/VS COBOL.

Storage should always be cleared by the program, regardless. It's just a good fail-safe technique/practice.

Never rely upon storage to EVER be pre-initialised. icon_wink.gif

Regards,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Library member auto insert option TSO/ISPF 3
No new posts Auto ticketing of a job failure ABENDS & Debugging 1
No new posts Break Auto update screen without message TSO/ISPF 2
No new posts Query related to inserting an auto po... DB2 4
No new posts Auto Job dependency Drawing tool for OPC IBM Tools 1
Search our Forums:

Back to Top