Reallocate SYSIN with DYNALLOC



High Level Assembler(HLASM) for MVS & VM & VSE

Reallocate SYSIN with DYNALLOC

Postby momi sabag » Mon Sep 21, 2009 11:15 am

Hi

I want an assembler code that is executed using a JCL job to reallocate the SYSIN ddname that was allocated in the JCL to a different file. I have tried to do it using the DYNALLOC macro. My macro invocations returns code 0 when I try to deallocate SYSIN, but nothing really happens (it remains allocated).
Has anyone done such a thing before and can point me in the right direction?

Thanks
momi sabag
 
Posts: 4
Joined: Mon Sep 21, 2009 11:11 am
Has thanked: 0 time
Been thanked: 0 time

Re: Reallocate SYSIN with DYNALLOC

Postby steve-myers » Tue Jun 15, 2010 7:53 pm

I just happened on this. I remembered encountering something like this long ago. I went to the manual (the manual is your friend!) and found DUNUNALC:
U        DC    A(X'80000000'+URB)
URB      DC    AL1(S99RBEND-S99RB,S99VRBUN,0,0)
         DC    2AL2(0)
         DC    A(UTXTPP,0,0)
UTXTPP   DC    A(UTXT02,X'80000000'+UTXT01)
UTXT01   DC    AL2(DUNDDNAM,1,L'UDDN)
UDDN     DC    C'SYSIN'
UTXT02   DC    AL2(DUNUNALC,0)
That worked perfectly!
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Reallocate SYSIN with DYNALLOC

Postby steve-myers » Thu Dec 02, 2010 8:03 pm

Dynamic allocation is described here. Read it! The data areas in my code snippet are described in 'SYS1.MACLIB(IEFZB4D0)' as well as in the manual. The dynamic allocation text unit keys are in 'SYS1.MACLIB(IEFZB4D2)' and are described in detail in the manual..

For better or worse dynamic allocation is relatively easy to use, though I find the code snippets in the manual hard to follow because they are taking a relatively simple data structure and building it dynamically. My code snippet in the post aimed to reduce the dynamic allocation data structures to their simplest possible form, though it can't be used as is in reenterable code.

Quite honestly, I don't use dynamic allocation in the way the manual tells me to use it because it requires too much code and it hides a fairly simple data structure. The method I use when I must use reenterable code is also hard to follow, though I don't think it's as bad as IBM's method, and it certainly uses much less code.

Before I wrote that post I wrote a simple test program to verify it worked as I expected, and I used the exact code snipppet I put in the post in that program to free the SYSIN allocation.

I think the failure of dynamic allocation to actually free the original SYSIN allocation is worth opening a PMR (that's the IBM term for a problem report) but I'm not in a position these days to do it.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Reallocate SYSIN with DYNALLOC

Postby steve-myers » Fri Dec 03, 2010 2:02 am

Just to expand on my last paragraph. The reason dynamic allocation did not free the SYSIN in the original post is the allocation had the "permanently allocated" attribute because it was allocated by a DD statement (or by dynamic allocation with the undocumented DALPERMA key). My issue is not that dynamic allocation did nothing, but that it did not fail the request with an appropriate reason and error code.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post