Focal Point
Want to show the output as mentioned

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

January 02, 2008, 08:27 AM
Moju
Want to show the output as mentioned
Hi I have a requirement where in I have to suffix '*' in the Job_desc column. Here JOB_DESC is the parameter which is getting passed from HTML to the Procedure.

Here is the sample output.

Dept Job_Desc
--------------------------
MIS Manager
Asst.Manager
Secratery
Developer

Condition is Salary greater that 1000, all the members beloning to the above group should be suffixed with '*'.

Here is the required output.

Dept Job_Desc*
--------------------------
MIS Manager*
Asst.Manager*
Secratery
Developer*

Here we can have the required output using "Computes". But here the column selected/Deselected dynamically. How to show the Computed field(Job_Desc8) rather that column field(Job_Desc).

My procedure code is as follows....

-SET &ECHO=ALL;
-DEFAULT &outcol1 = 'FIRST_NAME';
-DEFAULT &outcol2 = 'LAST_NAME';
-DEFAULT &outcol3 = '';
-DEFAULT &outcol4 = '';
-DEFAULT &outcol5 = '';
-DEFAULT &DEPT = 'DEPARTMENT';
-DEFAULT &WFFMT = 'AHTML';
-SET &SORT1 = IF &outcol1 NE '' THEN 'BY &outcol1.EVAL ' ELSE '';
-SET &SORT2 = IF &outcol2 NE '' THEN 'BY &outcol2.EVAL ' ELSE '';
-SET &SORT3 = IF &outcol3 NE '' THEN 'BY &outcol3.EVAL ' ELSE '';
-SET &SORT4 = IF &outcol4 NE '' THEN 'BY &outcol4.EVAL ' ELSE '';
-SET &SORT5 = IF &outcol5 NE '' THEN 'BY &outcol5.EVAL ' ELSE '';
-SET &SORT1 = IF &outcol1 EQ 'FIRST_NAME' THEN 'COMPUTE FN/A20V = IF EMPLOYEE.EMPINFO.CURR_SAL GT 10000 THEN ( EMPLOYEE.EMPINFO.FIRST_NAME | ' * ' ) ELSE ( EMPLOYEE.EMPINFO.FIRST_NAME );' ELSE '';
-SET &SORT2 = IF &outcol2 EQ 'FIRST_NAME' THEN 'COMPUTE FN/A20V = IF EMPLOYEE.EMPINFO.CURR_SAL GT 10000 THEN ( EMPLOYEE.EMPINFO.FIRST_NAME | ' * ' ) ELSE ( EMPLOYEE.EMPINFO.FIRST_NAME );' ELSE '';
-SET &SORT3 = IF &outcol3 EQ 'FIRST_NAME' THEN 'COMPUTE FN/A20V = IF EMPLOYEE.EMPINFO.CURR_SAL GT 10000 THEN ( EMPLOYEE.EMPINFO.FIRST_NAME | ' * ' ) ELSE ( EMPLOYEE.EMPINFO.FIRST_NAME );' ELSE '';
-SET &SORT4 = IF &outcol4 EQ 'FIRST_NAME' THEN 'COMPUTE FN/A20V = IF EMPLOYEE.EMPINFO.CURR_SAL GT 10000 THEN ( EMPLOYEE.EMPINFO.FIRST_NAME | ' * ' ) ELSE ( EMPLOYEE.EMPINFO.FIRST_NAME );' ELSE '';
-SET &SORT5 = IF &outcol5 EQ 'FIRST_NAME' THEN 'COMPUTE FN/A20V = IF EMPLOYEE.EMPINFO.CURR_SAL GT 10000 THEN ( EMPLOYEE.EMPINFO.FIRST_NAME | ' * ' ) ELSE ( EMPLOYEE.EMPINFO.FIRST_NAME );' ELSE '';
-RUN
TABLE FILE EMPLOYEE
PRINT
COMPUTE FN/A20V = IF EMPLOYEE.EMPINFO.CURR_SAL GT 10000 THEN ( EMPLOYEE.EMPINFO.FIRST_NAME | ' * ' ) ELSE ( EMPLOYEE.EMPINFO.FIRST_NAME ); NOPRINT
AS 'FIRST_NAME*'
'EMPLOYEE.EMPINFO.DEPARTMENT' NOPRINT
&outcol1 NOPRINT
&outcol2 NOPRINT
&outcol3 NOPRINT
&outcol4 NOPRINT
&outcol5 NOPRINT
&SORT1
&SORT2
&SORT3
&SORT4
&SORT5
WHERE DEPARTMENT CONTAINS &DEPT.(OR(FIND DEPARTMENT IN EMPLOYEE)).DEPARTMENT.;
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT.(,,,,).Select type of display output.
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$

Can anybody please help me out.

Thanks in advance.
January 02, 2008, 09:14 AM
FrankDutch
Moju

I do not understand why you make this so complex

TABLE FILE EMPLOYEE
PRINT 
     JOB_DESC
     FIRST_NAME
     COMPUTE ST/A2 = IF CURR_SAL GT 10000 THEN '*' ELSE '';
BY DEPARTMENT
END

This will give you a simple list to start with.
If that comes a bit ot what you want, you can start playing with concatenation of the fields.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7