View previous topic :: View next topic
|
Author |
Message |
kishore balya
New User
Joined: 17 Oct 2007 Posts: 12 Location: chennai
|
|
|
|
UNSPEC in pl/1 converts the given format to a bit string.
can any one explain in scenarios we will use this? |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
System related tasks:
Code: |
abend_code: proc(ch4) returns(char(5));
dcl ch4 char (4);
dcl w4b fixed bin (31);
dcl w4 char (4) based(addr(w4b));
dcl p4 pic '9999';
unspec(w4) = unspec(ch4) & '00fff000'bx;
if unspec(w4) then
do;
return('S' !! substr(hex(w4), 3, 3));
end;
else
do;
unspec(w4) = unspec(ch4) & '00000fff'bx;
p4 = w4b;
return('U' !! p4);
end;
end abend_code; |
Fast divide:
Code: |
2 h1 fixed (15,5) init (0),
- - - - - - - - - - - - - - -
dcl r(n) fixed (15) ctl;
- - - - - - - - - - - - - - -
unspec(h1) = unspec(r(i)); |
Masking:
Code: |
/**********************************************************************
* Round requested size up to next multiple of 8 bytes (allocations in *
* area's are always done in multiples of 8 bytes) Use of 'UNSPEC' is *
* substantially faster than the equivalent 'trunc(i_size / 16) * 16' *
**********************************************************************/
I_SIZE = I_SIZE + 7;
UNSPEC(I_SIZE) = UNSPEC(I_SIZE) & 'FFFFFFF8'BX; |
|
|
Back to top |
|
|
kishore balya
New User
Joined: 17 Oct 2007 Posts: 12 Location: chennai
|
|
|
|
Thanks a lot prino..
if possible can you explain the masking process |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
kishore balya wrote: |
if possible can you explain the masking process |
Holy crap, why can't you just try it yourself with a few values for I_SIZE (it's a FIXED BIN (31)), look at the results and see the pattern? |
|
Back to top |
|
|
kishore balya
New User
Joined: 17 Oct 2007 Posts: 12 Location: chennai
|
|
|
|
I am not havinG mainframe connection as of now.. |
|
Back to top |
|
|
|