Default statement



IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

Default statement

Postby nik ganchev » Wed Oct 03, 2012 9:01 pm

Hi All ,

I'm trying to understand a PLI program that has a strange (for me) Default statement :
 DEFAULT( POINTER & ¬PARAMETER )INIT( (*) PTRVALUE('ABCDABCD'XN));


PL\I version is Enterprise V4.R2

According to the docs DEFAULT statement should be followed by RANGE or DESCRIPTORS keywords, but they are missing in my case.
I'm also puzzled by POINTER & ¬PARAMETER expression - what does it mean?

I see that it should initialize some pointer(s) with a given value , but which pointers ? Can you give me a clue where I could find more info ?

Thanks in advance,
Nik
nik ganchev
 
Posts: 1
Joined: Wed Oct 03, 2012 8:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Default statement

Postby Akatsukami » Wed Oct 03, 2012 9:35 pm

nik ganchev wrote:Hi All ,

I'm trying to understand a PLI program that has a strange (for me) Default statement :
 DEFAULT( POINTER & ¬PARAMETER )INIT( (*) PTRVALUE('ABCDABCD'XN));


PL\I version is Enterprise V4.R2

According to the docs DEFAULT statement should be followed by RANGE or DESCRIPTORS keywords, but they are missing in my case.
I'm also puzzled by POINTER & ¬PARAMETER expression - what does it mean?

I see that it should initialize some pointer(s) with a given value , but which pointers ? Can you give me a clue where I could find more info ?

Thanks in advance,
Nik

This statement initializes all POINTERs that are NOT PARAMETERs to the value X'ABCDABCD'...which has no significance save that it is a known value that can easily be spotted in a dump; in my shop we use an identical DEFAULT statement, save that the value used is X'DEAD2BAD' :) If we see that value, we know that the pointer has not been given a valid value (and thus may be the cause of a S0C1 or S0C4 abend).

The RANGE clause indicates the range of names to which the statement applies; the default range, so to speak, is "*" (all names) and so, since this statement is intended to apply to all pointers it need not be specified. DESCRIPTORS is only for attributes that are to be applied to parameters; since we are explicitly excluding parameters, it is useless.

Read more about the DEFAULT statement here.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day

These users thanked the author Akatsukami for the post:
nik ganchev (Thu Oct 04, 2012 1:35 pm)
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to PL/I

 


  • Related topics
    Replies
    Views
    Last post