Migrating Custom Cobol Programs from Environment to Environment


From time to time you’ll either develop a custom cobol program in test and/or possibly upgrade a client from one version to another – meaning you’ll need to transfer all custom cobol programs.

Assuming you already know the custom programs that need to be transferred over, we need to check if they have library definitions.

Step 1:
Through LID and explorer, navigate to the custom programs main directory folder (found in %lawdir%/<product line>/<SystemcodeSRC>)
For this example we have a custom BN Screen called ZB220 in our %lawdir%/dev/bnsrc directory.

Migrating custom Cobol Programs from Environment to Environment

Go to the pdlib and wslib folders in same directory as custom programs:

Migrating custom Cobol Programs from Environment to Environment_2

Within those folders are library definition files that should start with a Z and end with either a PD or WS depending on what library you’re looking at.

Example of the PD library:

Migrating custom Cobol Programs from Environment to Environment_3

Now we need to dump these libraries and load them in new environment:
libdump <prodline> ZCALCPD.dmp ZCALCPD >> This dumps a file called ZCALCWS.dmp in whatever directory you’re currently in.

Now copy that ZCALCPD.dmp to the system you’re migrating it to and run a libload:
libload ZCALCPD.dmp <prodline>
Do this for the rest of the library definition files.

Now we need to migrate the actual ZB220 programs.
Make sure you’re in the programs main directory, for us this is %lawdir%/dev/bnsrc
Run a pgmdump:
pgmdump <prodline> BN ZB220.dmp ZB220

Now lets copy all ZB220 files over to our other environment so we could load them in:
cp %LAWDIR%/<prodline>/bnsrc/ZB220* \\<your other server>\<d$>\lawson\law\<prodline>\bnsrc
Open a second LID session and go to your 2nd servers main directory where we transferred the ZB220 files.
Run the pgmload command:
pgmload ZB220.dmp <prodline>

Now compile:
qcompile <prodline> BN ZB220
Wait 10-20 seconds to compile and lets now check for errors:
led <prodline> ZB220
Press F or G to check error logs, if errors a window will popup. If there are no errors, you’re done!