IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding PSEUDO VARIBLES


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sumanthmain

New User


Joined: 22 Aug 2005
Posts: 14

PostPosted: Wed Sep 28, 2005 2:38 am
Reply with quote

HI

Dear fourm mates

I Have a dought about pseudo varibles in p/1. could u plz give me brief explanation about that.

means

1) what is pseudo varibles ?

2)In which scenario we can use pseudo varibles ?

3) Give me one real time example?

Advance thanks
sumanth
Back to top
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Sat Oct 01, 2005 12:45 am
Reply with quote

Hi Sumanth,
Hope this helps...
(1) Pseudovariable:- A builtin function that can be used in the left hand side of an assignment statement as if it was a variable is called a pseudovariable.
(2)It's used when you need to assign value to the location which is accessed by the builtin function.Ex:-ONCHAR,ONSOURCE,SUBSTR
(3)Real time example:-
SUBSTR is a builtin function.It can be used as a pseudovariable.
Say,DATE1 is declared as CHAR(6) and it's in YYMMDD form.Now what ever may be the month,you need to force the month to December.This can be done as below.
SUBSTR(DATE1,3,2) = '12';

Do correct me for any mistake(s).
Thanks!
Sridevi.
Back to top
View user's profile Send private message
sumanthmain

New User


Joined: 22 Aug 2005
Posts: 14

PostPosted: Sat Oct 01, 2005 1:32 am
Reply with quote

Thanks sridevi for ur prompt reply.

Could u plz explain how we can use pseduo varibles in ONCHAR And ONSOURE AND IMG Funtion.

Advance thanks

regards
sumanth
Back to top
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Sat Oct 01, 2005 7:37 am
Reply with quote

Hi Sumanth,
ONCHAR and ONSOURCE buitin functions can be used only in ON units. These are useful for debugging,because it gives info on how particular condition has been raised. ONCHAR returns the character that raised the CONVERSION or the ERROR condition.ONSOURCE returns the content of the field that raised the CONVERSION or the ERROR condition.Both, can be used as pseudovariable as below.

Example: ONCHAR = '0';
ONSOURCE = '0';
This means you have reset both the character and the field that raised the condition to zero.

I guess,IMAG is the builtin function/pseudovariable you meant and misspelt it as IMG.
Say,A is a complex number of the form(X+iY) where X is real part and Y is imaginary part.To assign value to Y,IMAG pseudovariable can be used as below.
DCL A FLOAT DECIMAL(15) COMPLEX;
IMAG(A) = 1.414;

Thanks!
Sridevi.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Retaining Value of a Variable in Pseu... CICS 11
No new posts Pseudo-conversational mode in a XCTL ... CICS 6
No new posts pseudo conversation in cobol CICS 1
No new posts Pseudo Conversational programs - LINK... CICS 2
No new posts Pseudo RBA COBOL Programming 4
Search our Forums:

Back to Top