Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
sumanthmain

New User

Joined: 22 Aug 2005
Posts: 14

 Posted: Wed Sep 28, 2005 2:38 am    Post subject: Regarding PSEUDO VARIBLES 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

Sridevi_C

Active User

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

 Posted: Sat Oct 01, 2005 12:45 am    Post subject: 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.
sumanthmain

New User

Joined: 22 Aug 2005
Posts: 14

 Posted: Sat Oct 01, 2005 1:32 am    Post subject: Re: Regarding PSEUDO VARIBLES 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
Sridevi_C

Active User

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

 Posted: Sat Oct 01, 2005 7:37 am    Post subject: 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Retaining Value of a Variable in Pseu... sreekanth1984 CICS 11 Wed Sep 07, 2011 5:27 pm Pseudo-conversational mode in a XCTL ... Anuj Dhawan CICS 6 Thu Mar 10, 2011 8:39 pm pseudo conversation in cobol mikkilinenibalaji CICS 1 Sun Nov 07, 2010 9:44 am Pseudo Conversational programs - LINK... Gaurav Chauhan CICS 2 Fri Jul 23, 2010 12:52 pm Pseudo RBA swati1p COBOL Programming 4 Thu Feb 04, 2010 12:25 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us