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
 

 

Regarding PSEUDO VARIBLES

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Regarding PSEUDO VARIBLES
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    Post subject:
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    Post subject: Re: Regarding PSEUDO VARIBLES
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    Post subject:
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    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 Retaining Value of a Variable in Pseu... sreekanth1984 CICS 11 Wed Sep 07, 2011 5:27 pm
No new posts Pseudo-conversational mode in a XCTL ... Anuj Dhawan CICS 6 Thu Mar 10, 2011 8:39 pm
No new posts pseudo conversation in cobol mikkilinenibalaji CICS 1 Sun Nov 07, 2010 9:44 am
No new posts Pseudo Conversational programs - LINK... Gaurav Chauhan CICS 2 Fri Jul 23, 2010 12:52 pm
No new posts Pseudo RBA swati1p COBOL Programming 4 Thu Feb 04, 2010 12:25 pm


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