Page 2 of 2

Re: IEBUPDTE

PostPosted: Mon Mar 18, 2013 8:35 pm
by Akatsukami
c62ap90 wrote:
dick scherrer wrote:Hello and welcome to the forum,

P.S: I cannot post the code.
Use a little imagination before posting such nonsense. . .

Use a little imagination...
Maybe his dog ate the code.?.

Or. more likely, Pearl-chan lives under a bridge and eats billy goats.

Re: IEBUPDTE

PostPosted: Tue Mar 19, 2013 9:41 am
by steve-myers
Akatsukami wrote:... Or. more likely, Pearl-chan lives under a bridge and eats billy goats.
And doesn't realize he has run into Billy Goat Gruffs!

Another, "real world" example. This is a modification of a program that calls IDCAMS and uses the SYSIN exit to pass a LISTCAT LEVEL(xxx) command to IDCAMS, and uses the SYSPRINT exit to examine the output. The modification calls IDCAMS twice. The first call issues a LISTCAT ENTRIES(xxx), and uses a dummy SYSPRINT exit since all the program cares about is the return code. The second call is basically the original call, but it only executes if the first call returned with RC = 0. The first update group is the two calls, with modified setup. The second group is the update to the dynamic SYSIN exit to return the proper command to IDCAMS. The third group is the SYSPRINT IDCAMS exit to toss IDCAMS's SYSPRINT output into the bit bucket. The fourth group is the new parameter lists. The last group is the skeleton for the new IDCAMS command.
./ CHANGE
./ NUMBER INSERT=YES,SEQ1=20400000,NEW1=20410000,INCR=10000
         MVC   AUSERID,UUSER-USER(3)  COPY USERID TO LISTCAT ENT CMD
         MVI   IXSTAT,0            INDICATE LISTCAT ENT
         LINK  SF=(E,LINKIDCAMS),MF=(E,IDCPARMD)  CALL IDCAMS
         LTR   15,15               TEST RC
         JNZ   SKIPIDCAMS          BR IF NO ALIAS POINTER
         MVI   IXSTAT,1            INVOKE LISTCAT LEVEL
./ DELETE SEQ1=20600000,SEQ2=20600200
./ NUMBER INSERT=YES,SEQ1=50000000,NEW1=50200000,INCR=100000
         LHI   15,4                SET EOF RETURN CODE
         L     14,8(,1)            LOAD ADDR OF I/O BUFFER WORDS
         CLI   IXSTAT,X'FF'        TEST IF RETURN EOF
         JE    IDCR0200            BR IF SO
         LA    1,=A(ACARD,L'ACARD) LOAD LENGTH AND ADDRESS OF THE
*                                   LISTCAT ENTRIES(XXX) COMMAND
         CLI   IXSTAT,0            TEST IF LISTCAT ENTRIES(XXX) COMMAND
         JE    *+L'*+4             BR IF SO
         LA    1,=A(IXCARD,L'IXCARD) LOAD LENGTH AND ADDRESS OF THE
*                                   LISTCAT LEVEL(XXXX) COMMAND
         MVI   IXSTAT,X'FF'        RESET IXSTAT
         MVC   0(8,14),0(1)        SAVE ADDRESS & LENGTH FOR IDCAMS
         SR    15,15               SET RC = 0
./ DELETE SEQ1=50200000,SEQ2=52000000
./ NUMBER INSERT=YES,SEQ1=62200000,NEW1=62210000,INCR=10000
         SPACE 1
IDCDUMMYW SR   15,15
         BR    14
./ NUMBER INSERT=YES,SEQ1=66200000,NEW1=66210000,INCR=10000
IDCPARMD CALL  ,(IDCNULL,IDCNULL,IDCNULL,IDCIOD),VL,MF=L IDCAMS PARMS
IDCIOD   DC    A(2)                IDCAMS I/O EXIT PARMS
         DC    A(IDCDD1,IDCREAD,MAINPGM)   SYSIN
         DC    A(IDCDD2,IDCDUMMYW,MAINPGM) SYSPRINT
./ NUMBER INSERT=YES,SEQ1=74000000,NEW1=74010000,INCR=10000
         SPACE 1
ACARD    DC   0C' LISTCAT ENTRIES(XXXXXXXX)',C' LISTCAT ENTRIES('
AUSERID  DC    CL8' ',C')'
In the first version of the update there was a very confusing bug: IDCAMS got an S0C1 in a fairly strange location. After some analysis comparing the before and after versions of the program I realized the exit was missing the L 14,8(,1) instruction; I think reg 14 still pointed to IDCAMS when it did the MVC 0(8,14),0(1) instruction. After the L 14 instruction was added to the exit it appeared to work perfectly. This is still a work in progress, though, so there may be more problems since the initial test was a just a point test. There are two changes from the true update to what is here. Where you see MAINPGM the actual code uses the true name of the program CSECT. The second change removed a couple of continuation markers where a comment extended to a second line, and the second line was changed to a comment so the code box would display the update better. These are the kind of changes the TS could make in his problem. Actually, since the TS couldn't get the Billy Goats to respond to the request, I suspect the TS has abandoned this topic.

Twenty five years ago when I was reading stories to my son, this fable - probably adapted from a Grim brothers fairy tale - was one of our favorites.