Focal Point
[SOLVED] Passing a Value

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2061076403

October 30, 2008, 10:52 AM
kitten
[SOLVED] Passing a Value
Hello everyone,

I have a procedure that has multiple procedures. Each procedure prompts for a &termcode value. Is there a way to enter the value once and have it pass from one procedure to the next. That way I don't have to hard code and the enduser doesn't have to enter the parameter multiple times. I tried to give an example below:

TABLE FILE AS_STUDENT_ENROLLMENT_SUMMARY
PRINT
ID
LAST_NAME
FIRST_NAME
MIDDLE_INITIAL
ENROLLMENT_AR_IND
CLAS_CODE
TOTAL_BILLING_HOURS
OVERALL_LGPA_GPA
MAJR_DESC1
BY PIDM_KEY
HEADING
""
FOOTING
""
WHERE TERM_CODE_KEY EQ '&TERM_CODE_KEY.Enrollment Term Code.';
WHERE ( TOTAL_BILLING_HOURS GT 0 );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS INDHOLD FORMAT FOCUS INDEX 'PIDM_KEY'

TABLE FILE SLRRASG
PRINT
SLRRASG_TERM_CODE
SLRRASG_BLDG_CODE
SLRRASG_ROOM_NUMBER
SLRRASG_BEGIN_DATE
SLRRASG_END_DATE
SLRRASG_AR_IND
BY SLRRASG_PIDM
HEADING
""
FOOTING
""
WHERE SLRRASG_TERM_CODE EQ '&SLRRASG_TERM_CODE.Room Term Code.';
WHERE SLRRASG_ASCD_CODE EQ 'AC';
ON TABLE SET PAGE-NUM OFF
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE HOLD AS HOUSHOLD FORMAT FOCUS INDEX 'SLRRASG_PIDM'

TABLE FILE SLRMASG
PRINT
SLRMASG_BEGIN_DATE
SLRMASG_END_DATE
SLRMASG_MSCD_CODE
SLRMASG_AR_IND
SLRMASG_MRCD_CODE
BY SLRMASG_PIDM
HEADING
""
FOOTING
""
WHERE SLRMASG_TERM_CODE EQ mmm;
WHERE SLRMASG_MSCD_CODE EQ 'WD' OR 'AC';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS MEALHOLD FORMAT FOCUS INDEX 'SLRMASG_PIDM'

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
October 30, 2008, 11:14 AM
GinnyJakes
You can try using a global amper variable, &&var. They are valid for the entire session.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 30, 2008, 12:56 PM
kitten
Ginny do I just add && where the variable appear or do I have to declare it somewhere in the beginning?


WebFOCUS 7.6.2, MS Windows Server/______, Excel, PDF, HTML
October 30, 2008, 02:18 PM
GinnyJakes
Well, it depends. You can prompt for the single amper variable in the main parent program. Once in there, set the double amper variable with the contents of the single. In your child program, reference the double.

You don't have to declare it. Just make sure that it has a value when it needs to.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 31, 2008, 08:25 AM
Clinton Side-Kick
This might be a redundant comment:
If the child fexes are -INCLUDEd ie.
-INCLUDE child_fex_name
then you should be fine.
If the child fexes are EXecuted ie.
EX child_fex_name
then you want to pass the parameter as follows:
EX child_fex_name TERM_CODE_KEY=&TERM_CODE_KEY
enclose &TERM_CODE_KEY in single quotes if the value may contain spaces.
Regards


--------------------------------------------------------------------------------
prod: WF/AS 8.2.05; OmniGen;
In FOCUS since 1991
October 31, 2008, 11:22 AM
sosterle
Don't know if this will help or not, but I do alot of procedures with multiples reports and the easiest way I found to pass a parameter is set a default at the beginning of the procedure. For example:

-DEFAULT &YEAR='2008'

and then whenever &YEAR appears anywhere in the procedure, it will pick up whatever data is input in the parameter.


PROD: WebFocus 7.6.9 on WinXP