Focal Point
How to get the output in the mentioned format?

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

February 08, 2007, 01:43 AM
manash
How to get the output in the mentioned format?
hi

I have a input file with 5 fields

roll no. name phone email fax no.
------- ------ ------- --------- --------
111 aaa 1234567 a@yyy.com 1234567
222 bbb 2345678
333 ccc c@yyy.com


Now in the output file I need to print the fields in following format

roll no. NAME name
PHONE phone
EMAIL email
FAX NO. fax no.

NOTE:- That the words written with caps on are labels not fields and the one with caps off
are fields.

the output should be as follows:-

111 NAME aaa
111 PHONE 1234567
111 EMAIL a@yyy.com
111 FAX NO. 1234567
222 NAME bbb
222 PHONE 2345678
333 NAME ccc
333 EMAIL c@yyy.com

Note:- The fields which are null for a particular roll no. should not be printed
As roll no. 222 does'nt have email and fax field so they are not printed in the output.
February 08, 2007, 04:29 AM
FrankDutch
did you download the manual?

try the command "OVER"

so

TABLE FILE CAR
PRINT 
     COUNTRY AS 'c:' OVER 
     CAR AS 'x:' OVER 
     MODEL AS 'm:' OVER 
     COMPUTE SPACE/A1 = ''; AS ''
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
END 





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

February 08, 2007, 04:50 AM
FrankDutch
your second question is a select:

WHERE EMAIL NE '';

And if you want to repeat the ROLLNO
PRINT 
ROLLNO AS ''  NAME OVER
ROLLNO AS '' PHONE OVER
ROLLNO AS '' EMAIL OVER
ROLLNO AS '' FAXNO 


But if you just want to suppress only lines when the value is empty you have to do this in a complete other way.
First put all the data into a new hold file per field.
But than you need the fields to have the same picture (p.e. A25)

-SET ASNAMES= ON
TABLE FILE XXX
PRINT ROLLNO 
COMPUTE FNAME/A10="PHONE" 
PHONE AS 'FVALUE'
ON TABLE HOLD AS HOLDPHON
WHERE PHONE NE '';
END
TABLE FILE XXX
PRINT ROLLNO 
COMPUTE FNAME/A10="EMAIL" 
EMAIL AS 'FVALUE'
ON TABLE HOLD AS HOLDMAIL
WHERE EMAIL NE '';
END
etc


Then combine the HOLD files

TABLE FILE HOLDMAIL
PRINT ROLLNO FNAME FVALUE
ON TABLE HOLD
MORE
FILE HOLDPHON
MORE
FILE HOLDFAX
MORE
...
END

TABLE FILE HOLD
PRINT *
END


Let me know if it works

and download the manual, it will help you a lot.

Frank




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

February 08, 2007, 11:22 PM
manash
Ya Frank it worked .Thanx a lot.
And ya I downloaded the manual and i m going through it.


FOCUS 7.1.1/ MF(OS/390)