Re: subroutine storage can be used by another?



Hi Liao,

<wenson_liao@xxxxxxxx> wrote in message
news:<1150113090.469974.23770@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
Hello All

Recently,I wrote a COBOL program A which call subroutine B and C
statically,B and C are assembler,
the function of subroutine B is:
1)modify RECSIZE and BLKSZIE of a dataset by RDJFCB and OPEN macro
2)then pass the DCB address to program A

the function of subroutine B is:
1) PUT a record according to DCB address

The program A executed well!

But,when I add some code to make it could access a DB2 table, it
executed abend 0C4, the ceedump as follow:


Given the above information from the original poster, I am not sure other than for training purposes why this is being attempted.

As the objective is to write a record to an output data set, which appears to have consistent attributes during execution but which may differ from execution to execution, the question arises "Is Assembler needed at all?"

Provided the Cobol program is correctly defined to cater for the variety of output circumstances surely the requirement can be met simply by changing the LRECL externally, i.e. either in the JCL or via use of a pre-allocated data set. Use of System Determined BLKSIZE (SDB) should satisfy the need to change LRECL and BLKSIZE. (But is RECSIZE a term used more frequently with VSAM.)

If an Assembler routine needs to be in equation then I would agree with Bill Klein that the usual way for achieving the linkage between Cobol and Assembler is for the Cobol program to perform the Call passing the FD name (DCB) as a parameter, i.e. program A contains "CALL 'B' Using FD-outfile"

Within Program B DSECT IHADCB can be used as an overlay (effectively REDEFINES) of the DCB with the LRECL and BLKSIZE values being changed directly via use of the appropriate labels. I am reasonably certain that there is no need to resort to RDJFCB to do this given the OPEN/MERGE sequence. Open for non-VSAM files will merge attributes from Program, JCL, and File (DSCB) in that order so if the DCB is changed there should be no need to update the JFCB (JCL). (I believe RDJFCB need authorisation if updating fields so my suggestion avoids that particular security issue.)

To write the record program A simply issues "CALL 'B' Using FD-outfile, outarea"

I have deliberately avoided the issues of dynamic allocation, and VSAM files. The above comments are specifically related to non-VSAM files. (I have not used them in anger, but the use of the MODGEN macro within an Assembler routine is likely to be a requirement for VSAM.)

I have used the techniques described to alter the DDNAME of a file, so that a Cobol program has a single FD, but multiple DD statements processed consecutively, and in that instance an Assembler routine is necessary.

Kind regards - Terry

Terry Sambrooks
Director
KMS-IT Limited
228 Abbeydale Road South
Dore
Sheffield
S17 3LA
UK

Tel: +44 (0)114 262 0933
WEB:
www.legac-e.co.uk
www.kmsitltd.co.uk

Reg: England & Wales 3767263 at the above address

All outgoing E-mails are scanned but it remains the recipients responsibility to ensure that their system is protected from viruses, trojans, worms, and spy-ware.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

.



Relevant Pages

  • Fw: subroutine storage can be used by another?
    ... I can tell you the "normal" way of using Assembler subprograms to ... This will give the Assembler subprogram addressability to the DCB. ... Recently,I wrote a COBOL program A which call subroutine B and C ...
    (bit.listserv.ibm-main)
  • Re: HLA History
    ... Maybe you are right, DOS is obsolete ... listing generated by the assembler. ... execution of code belonging to the operating system (in this ... the instruction after the int instruction. ...
    (alt.lang.asm)
  • Re: the pipeline of C64x+
    ... I have a chance of programming on C64x+ from TI. ... The pipeline executes one VLIW instruction package per cycle. ... Each of this packages may have instructions for each of the eight execution units. ... I had my share of assembler coding on the C64x+ and it's a lot of work. ...
    (comp.dsp)
  • Re: calculation of execution time of assembly code in a realtime program with large number of tasks
    ... I have various tasks running. ... assmbly and another printf at the end of assmbly code that prints the ... current time the only way for caculating the assmbly code execution ... Calling 'printf' at the start and end of 20 lines of assembler is ...
    (comp.arch.embedded)
  • Re: Disobeying jet engines - why?
    ... This really isn't a particularly good example because on a lot of CPUs there is an almost 1 to 1 correspondence between each line of C here and an assembler instruction. ... I challenge the ASM will do everything you need crowd to write a QUINE in their favourite assembler language. ... The errata lists are surprisingly short considering how much clever stuff like register colouring and speculative execution is going on the background to keep the thing fully utilised at every clock cycle. ...
    (sci.electronics.design)