08.11.2014 Views

Software Reference Manual - NetEx

Software Reference Manual - NetEx

Software Reference Manual - NetEx

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example of Receiving Record Module (IBM Assembler)<br />

*<br />

* Example of receiving record module, hence the name ‘RCRECMOD’<br />

* which, in this case, receives a Unisys print record and<br />

* creates the equivalent IBM print record(s).<br />

*<br />

RCRECMOD CSECT<br />

*<br />

* General housekeeping<br />

*<br />

* Entry conditions:<br />

* R1: Parm list (in RMPARM DSECT)<br />

*<br />

SAVE (14,12),,* Save caller’s regs<br />

LR R12,RI5 Load entry address<br />

USING RCRECMOD,R12 Establish addressability<br />

LR R11,RL Copy address of parm list<br />

USING RNPARM,R11 Base it with R11<br />

LA R2,RMSAVE Load addr of savearea into R2<br />

ST R13,4(,R2) Save addr of caller’s savearea at +4<br />

ST R2,8(,R13) Store addr of my savearea in caller’s area<br />

LR R13,R2 R13 now contains addr of savearea<br />

*<br />

* Check BUFLEV<br />

*<br />

ICM R1,B'1111',RBUFLEV Get BUFLEV<br />

BNM NEXT 1st time (-1)? Skip if not<br />

*<br />

* BUFLEV = -1. First time entry.<br />

*<br />

* Insert the passed ddname into the DCB,<br />

* open the file,<br />

* send an ‘open’ message,<br />

* and return.<br />

*<br />

LA R10,PRINT Set up R10<br />

MVC 40(8,RIO),RDDNAME Insert the provided ddname<br />

OPEN (PRINT,(OUTPUT)) Open the print file<br />

MVC RBUFLEV,=F’134’ RETURN MAX LRECL IN BUFLEV<br />

MVC RMSGLEN,=F’19’ Msg is 19 characters long<br />

MVC RMSGLEV,=F’5’ Message level is ‘5’<br />

MVC RMSG(15),OPMSG Give msg to caller as expected<br />

B EXIT<br />

*<br />

* BUFLEV is not negative. Subsequent entries (or problem).<br />

*<br />

NEXT CLI RBUFLEV+3,15 Check for normal data Xfer<br />

BL WRITREC Branch to write routine, if so<br />

BE EOF Branch to EOF routine, if so<br />

*<br />

* Else, fall through to the abort routine.<br />

*<br />

ABORT MVC RBUFLEV,=F’16’ Indicate abort<br />

Page 68 Appendix A: User Modules MAN-REF-H211-05

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!