|
View previous topic :: View next topic
|
| Author |
Message |
satish.ms10
Active User

Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
Hi All,
I am extracting business rules from a COBOL program to write an equivalent Java program. My COBOL program is calling an assembler program with 3 parameters. I am not very good at assembler.
I am not able to understand the functionality of the assembler program. Could some one explain me the logic or help me with pseudo code. Here is the code.
| Code: |
DC_CBL DSECT
NAME DS CL8
E11 DS F
L11 DS F
SPACE 5
AMODE 31
RMODE ANY
BEGINING CSECT
BR 15
SPACE 3
USING DC_CBL,3
DC AL1(7)
DC CL7'PGMAIMS'
ENTRY LOADING
USING LOADING,4
LOADING STM 14,4,12(13)
LR 4,15
L 3,0(3)
LA 3,0(3)
C 3,12(3)
BE CALLING
NC 8(8,3),8(3)
BZ MODLOAD
LA 1,9005
ABEND (1)
MODLOAD LOAD EPLOC=NAME
ST 0,8(3)
ST 3,12(3)
MODELES XR 2,2
BSM 2,0
LTR 2,2
BZ CHKMOD24
TM 8(3),X'80'
BO LOADOK12
LA 1,9007
ABEND (1)
CHKMOD24 TM 8(3),X'80'
BZ LOADOK12
LA 1,9006
ABEND (1)
SPACE 2
LOADOK12 NOPR 0
CALLING LM 14,1,12(13)
AL 1,KEY4
L 15,8(3)
LM 2,4,(12+(4*4))(13)
XC 12((7*4),13),12(13)
BR 15
LA 0,9008
ABEND (0)
KEY4 DC F'4'
DROP 4
EJECT
DC AL1(7)
DC CL7'PGMEIMS'
ENTRY DELETEE
USING DELETEE,4
DELETEE STM 14,12,12(13)
LR 4,15
L 3,0(1)
L 3,0(3)
LA 3,0(3)
C 3,12(3)
BE DEL_OKAY
NC 8(8,3),8(3)
BZ DELETEOK
LA 0,9005
ABEND (0)
DEL_OKAY DELETE EPLOC=NAME
LTR 15,15
BZ DELETEOK
LA 1,3507(15)
ABEND (1)
DELETEOK XC 8(8,3),8(3)
LM 14,12,12(13)
BR 14
CNOP 4,8
DC AL2(*-BEGINING+12)
DC CL8'PGMAIMSZ',XL2'971A'
DS 0X
END |
Thanks in advance. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| It could help if you show the CALL and the definitions of the items on the CALL. |
|
| Back to top |
|
 |
satish.ms10
Active User

Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
Thanks Bill for your quick reply.
Here is the item definitions.
| Code: |
01 ARG01.
05 MOD PIC X(08) VALUE IS 'MAINPGM'.
05 RET1 PIC S9(9) USAGE IS BINARY VALUE IS ZERO.
05 RET2 PIC S9(9) USAGE IS BINARY VALUE IS ZERO.
01 SUBPGM PIC X(08) VALUE 'SUBPGM'.
01 ARG02.
05 KEYDATA PIC X(10).
05 OPERATION PIC X(4).
05 STATCODE PIC X(10).
05 PCBINFOPTR USAGE IS POINTER.
05 IOAREAPTR USAGE IS POINTER.
05 RETCODE PIC S9(9) USAGE IS BINARY.
01 ARG02PTR USAGE IS POINTER.
|
And the CALL statement is
| Code: |
SET ADDRESS OF ARG02 TO ARG02PTR
CALL LOADING USING ARG01 SUBPGM ARG02PTR. |
Let me know if I missed any required information.
Kindly help me. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| satish.ms10 wrote: |
Let me know if I missed any required information.
|
The name of the idiot who wrote the COBOL program? I mean, we only have 30 characters for data-names and in RET1 and RET2 they've used four more than absolutely necessary. What a waste of typing.
Of course, now the names are no real help in understanding what the program does. But that is minor, a few hours or days wasted later, whilst they managed to implement 0.2s more quickly.
Someone with IMS knowledge may be able to say something as to why, but it seems to be a program used to load, if necessary, then call, and, separate entry-point, so at some other logical point, delete - programs.
I think it is something local to your site ("LOADING" is a silly name for a program). Ask around there.
This may be a throwback to older times (Language Environment does this stuff from for COBOL CALLs) and may not be required at all.
As well as asking around, see if anyone IMS turns up here, or someone to fill in the details on the ASM.
Presumably you already have details on how your Java is going to run and interact successfully. I don't think you'll be needing a "loader", but if you do, someone has presumably mentioned it to you or documented it somewhere along the way in the design. |
|
| Back to top |
|
 |
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Well, there are other issues.- As written, the program will not assemble. I very much doubt the program, in the form it was presented by satish.ms10 is actually used.
- As written, it seems the program expects register 3 to be pointing to the ARG01 structure. It is totally foolish to expect anything like this in compiled code. Again, I very much doubt the program, in the form it was presented by satish.ms10 is actually used.
|
|
| Back to top |
|
 |
Bill O'Boyle
CICS Moderator

Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
| The LA instruction of a value into R1 just prior to the ABEND is too large. Max value for an LA is 4095. Change the LA to an LHI (max=32767) or an LAY (max=524287). Other than that, I agree this program needs further scrutiny and resolve. |
|
| Back to top |
|
 |
Bill O'Boyle
CICS Moderator

Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Just a thought.
Assuming this is a Batch program, review PROCEDURE-POINTER (introduced with COBOL/370 in the early 1990's), which acts like an Assembler "LOAD" Macro under the covers.
You can use PROCEDURE-POINTER directly in the Batch COBOL program.
Use the CICS API "LOAD PROGRAM" in CICS environments. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The COBOL is being migrated to Java, so probably not batch. I don't know if Java can do that.
TS/OP has gone quiet anyway :-) |
|
| Back to top |
|
 |
satish.ms10
Active User

Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
Hi All,
Thank you very much for kind support.
We have requested the customer for the functional requirements that needs to be implemented as part of assembler program migration.
Thanks again for your help. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|