PL/I

PL/I

PL/I

 View Only
  • 1.  Data lost when I move from automatic variable

    Posted Wed December 03, 2014 06:07 AM

    I move part of a declared area to a controlled one, and again from the same area to another variable. The second time, the data inside the area I'm moving from haven't keep the information.

    ARE1S1 =  SUBSTR(AREA11,3,JJ);                Here AREA11 has 'ACACFECHA       A9912' and more until 666 characters
    CLAVI =  SUBSTR(AREA11,1,25);                         Here AREA11 has '0101010101010101010101010'

    There are no instructions between. If I change the second sentence:

    CLAVI =  SUBSTR(ARE1S1,1,25);                   I get CLAVI=''ACACFECHA...' the first 25 characters of AREA11 that were moved to ARE1S1.

    With PL/I 3.8 it is working without problem, but testing the same program in PL/I 4.4 it doesn't. First of all, I'm a beginner with PL/I, and I don't know if there has been any change in the way the compiler manages the memory were variables are stored. 

    Does anyone had an idea of what has changed?

    Thanks in advance

     

     

     

     

     

     

    amartinmar


  • 2.  Re: Data lost when I move from automatic variable

    Posted Wed December 03, 2014 06:31 AM

    Do you have STRINGRANGE and STRINGSIZE enabled?

    Robin400


  • 3.  Re: Data lost when I move from automatic variable

    Posted Fri December 05, 2014 05:49 AM

    I have NOSTRINGRANGE and NOSTRINGSIZE. But I've tried, changing to this value, and it does the same.

    amartinmar


  • 4.  Re: Data lost when I move from automatic variable

    Posted Fri December 05, 2014 07:54 AM

    Are you saying that you tried STRINGRANGE AND STRINGSIZE?

     

    Do you use arrays?  If so, you also need SUBSCRIPTRANGE.

    Robin400


  • 5.  Re: Data lost when I move from automatic variable

    Posted Mon December 08, 2014 04:14 AM

    Hi Amartinmar,

    Have you resolved this?

    If not, for help you will need to provide more of the program --

    declarations; ALLOCATE statement for ARE1S1; PUT statements before and after the two lines

    shown, along with the results.

    When you run the program, be sure to enable STRINGRANGE, STRINGSIZE, SUBSCRIPTRANGE.

     

     

    Robin400


  • 6.  Re: Data lost when I move from automatic variable

    Posted Wed December 10, 2014 08:00 AM

    As Robin wrote we're missing the interesting parts of your code.

    Just a thought: what's the value of "jj" in your snipplet at execution time? 
    When does it get its value? Maybe its just uninitialized and runtime options determine if its set to 0 or >0 (on z/OS there is a STORAGE option).

    Then your results make (some) sense.

    I would suggest to have a closer look at all the involved variables (as robin said) - in particular JJ.

    br johann

    woecki