Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

UNSPEC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
kishore balya

New User


Joined: 17 Oct 2007
Posts: 12
Location: chennai

PostPosted: Fri Sep 04, 2009 10:36 am    Post subject: UNSPEC
Reply with quote

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
View user's profile Send private message

prino

Senior Member


Joined: 07 Feb 2009
Posts: 1018
Location: Oostende, Belgium

PostPosted: Fri Sep 04, 2009 10:45 am    Post subject:
Reply with quote

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
View user's profile Send private message
kishore balya

New User


Joined: 17 Oct 2007
Posts: 12
Location: chennai

PostPosted: Fri Sep 04, 2009 11:10 am    Post subject:
Reply with quote

Thanks a lot prino..
if possible can you explain the masking process
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1018
Location: Oostende, Belgium

PostPosted: Fri Sep 04, 2009 11:48 am    Post subject:
Reply with quote

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
View user's profile Send private message
kishore balya

New User


Joined: 17 Oct 2007
Posts: 12
Location: chennai

PostPosted: Fri Sep 04, 2009 11:59 am    Post subject:
Reply with quote

I am not havinG mainframe connection as of now..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNSPEC in PL1. saubhik PL/I & Assembler 1 Sat Nov 14, 2009 8:06 pm
No new posts What is use of UNSPEC builtin functio... letmeknow PL/I & Assembler 3 Thu Mar 01, 2007 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us