Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Displaying Columns one after the other???

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Displaying Columns one after the other???
 Login/Join
 
Guru
posted
Hi,

I want my report to be displayed like this
Column1FieldNames	Column2-DataNames
COUNTRY 	         ENGLAND
COUNTRY	 	ENGLAND
COUNTRY		ENGLAND
COUNTRY		ITALY
COUNTRY		ITALY
COUNTRY		JAPAN
COUNTRY		JAPAN
CAR		JAGUAR
CAR		JENSEN
CAR		TRIUMPH
CAR		ALFA ROMEO
CAR		MASERATI
CAR		DATSUN
CAR		TOYOTA

Note:Column can be alphanumeric or numeric. Total number of columns is 50 in my requirement.

I can accomplish this using FILEDEF by appending one over the other. But, is there any other simple way to do this?
  
SET HOLDLIST=PRINTONLY

FILEDEF HLD DISK HLD.FTM
-RUN
TABLE FILE CAR
PRINT 
COMPUTE COUNTRY1/A16=COUNTRY; 
ON TABLE HOLD AS HLD
END

FILEDEF HLD DISK HLD.FTM( APPEND
-RUN
TABLE FILE CAR
PRINT 
COMPUTE COUNTRY1/A16=CAR; 
ON TABLE HOLD AS HLD
END

TABLE FILE HLD
PRINT *
END


Thanks,
Rifaz

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


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Gold member
posted Hide Post
Hi Rifaz,
Please use below code.
Hope this helps.

SET ACROSSPRT = COMPRESS
DEFINE FILE CAR
CNTCR/D3 WITH MODEL=CNTCR+1;
END
TABLE FILE CAR
PRINT
CAR AS 'Car' OVER
COUNTRY AS 'Country' OVER
MODEL AS 'Model'
ACROSS CNTCR AS '' NOPRINT
ON TABLE PCHOLD FORMAT EXL2K
END


WF 8.1.04,Infoassist,Oracle, Excel, PDF,HTML.
 
Posts: 82 | Registered: January 06, 2014Report This Post
Virtuoso
posted Hide Post
Rifat,

Try this one:
  
DEFINE FILE CAR
ROOT/A1=' ';
FCO/A12='COUNTRY';
FCA/A12='CAR';
FBO/A12='BODYTYPE';
VCO/A20=COUNTRY;
VCA/A20=CAR;
VBO/A20=BODYTYPE
END
TABLE FILE CAR
PRINT
ROOT FCO VCO
     FCA VCA
     FBO VBO

ON TABLE SAVE AS RIFAZ
END

-RUN
EX -LINES 8 EDAPUT MASTER,RIFAZ,C,MEM
FILENAME=RIFAZ, SUFFIX=FIX
 SEGNAME=RIFAZ, SEGTYPE=S0
  FIELDNAME=ROOT, ALIAS=ROOT, FORMAT=A1, ACTUAL=A1, $
 SEGNAME=VALS, PARENT=RIFAZ, OCCURS=VARIABLE
  FIELDNAME=TR, ALIAS=TR, FORMAT=A12, ACTUAL=A12, $
  FIELDNAME=VR, ALIAS=VR, FORMAT=A20, ACTUAL=A20, $
  FIELDNAME=CNTR, ALIAS=ORDER, FORMAT=I2, ACTUAL=I4,$
-RUN
TABLE FILE RIFAZ
PRINT TR VR
BY CNTR NOPRINT
END

This message has been edited. Last edited by: Danny-SRL,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
The Macgyver technique may also help, but this is guess work, as we do not know what the source data looks like


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Guru
posted Hide Post
Thanks Daniel for your technique,

However, as i mentioned earlier, my table has mixture of alphanumeric/numeric. Now, how do i include DEALER_COST/SALES in this technique.When i try using this, it appends with trailing zeros.Tried like
 
FDE/A12='DC';
VDE/A20=EDIT(DEALER_COST);
 

I couldn't completely understood sequential MFD.

My understandings,
1. Retrieve the original datas & hold it.
2. Second, using the known blank value(PARENT SEGMENT), you describe the sequential MFD respective to the original one.

Correct me, if i'm wrong?

Then, how do you interlinked 1st HOLD file with 2nd one? Because, 1st HOLD file has 7 columns including ROOT(Blank) & 2nd one has only 3 columns.

Waz,

I understood without knowing the Master file structure, we can't create the FSEQ.I've gone through OCCURS attribute in Help Doc, might need to look it again.We're gonna use SQLPASSTHRU though.

I never used MacGyver/FSEQ in my experience. It would be great, if anyone provide a little explanation or else refer me to a good article.

Thanks,
Rifaz


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Virtuoso
posted Hide Post
Rifaz,
Instead of EDIT use FPRINT:
  
DEFINE FILE CAR
ROOT/A1=' ';
FCO/A12='COUNTRY';
FCA/A12='CAR';
FBO/A12='BODYTYPE';
FDC/A12='DEALER COST';
VCO/A20=COUNTRY;
VCA/A20=CAR;
VBO/A20=BODYTYPE;
VDC/A20=FPRINT(DEALER_COST, 'D7', 'A20');
END
TABLE FILE CAR
PRINT
ROOT FCO VCO
     FCA VCA
     FBO VBO
     FDC VDC

ON TABLE SAVE AS RIFAT
END

-RUN
EX -LINES 8 EDAPUT MASTER,RIFAT,C,MEM
FILENAME=RIFAT, SUFFIX=FIX
 SEGNAME=RIFAT, SEGTYPE=S0
  FIELDNAME=ROOT, ALIAS=ROOT, FORMAT=A1, ACTUAL=A1, $
 SEGNAME=VALS, PARENT=RIFAT, OCCURS=VARIABLE
  FIELDNAME=TR, ALIAS=TR, FORMAT=A12, ACTUAL=A12, $
  FIELDNAME=VR, ALIAS=VR, FORMAT=A20, ACTUAL=A20, $
  FIELDNAME=CNTR, ALIAS=ORDER, FORMAT=I2, ACTUAL=I4,$
-RUN
TABLE FILE RIFAT
PRINT TR VR
BY CNTR NOPRINT
END


Also, I really don't understand your comment:
quote:
Then, how do you interlinked 1st HOLD file with 2nd one? Because, 1st HOLD file has 7 columns including ROOT(Blank) & 2nd one has only 3 columns.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Guru
posted Hide Post
Thanks really Daniel for your response,

I meant to ask,

TABLE FILE CAR
PRINT
ROOT FCO VCO
     FCA VCA
     FBO VBO
     FDC VDC

ON TABLE SAVE AS  [B]RIFAT[/B]
END  

It(1st HOLD file) has 7 fields in it, including ROOT(Blank value which is common field).

 EX -LINES 8 EDAPUT MASTER,[B]RIFAT[/B],C,MEM
FILENAME=RIFAT, SUFFIX=FIX
 SEGNAME=RIFAT, SEGTYPE=S0
  FIELDNAME=ROOT, ALIAS=ROOT, FORMAT=A1, ACTUAL=A1, $
 SEGNAME=VALS, PARENT=RIFAT, OCCURS=VARIABLE
  FIELDNAME=TR, ALIAS=TR, FORMAT=A12, ACTUAL=A12, $
  FIELDNAME=VR, ALIAS=VR, FORMAT=A20, ACTUAL=A20, $
  FIELDNAME=CNTR, ALIAS=ORDER, FORMAT=I2, ACTUAL=I4,$
-RUN 


It(2nd HOLD file) has only 3 fields ROOT(Blank value which is common field in both, TR, VR).

Can you please tell me, how TR column comprises of FCO,FCA,FBO,FDC and VR column has VCO,VCA,VBO,VDC

TABLE FILE RIFAT
PRINT TR VR
BY CNTR NOPRINT
END  


To be honest, i don't really understand your Sequential master file. Apologies, if its the basic one.

Thanks,
Rifaz


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Virtuoso
posted Hide Post
FILENAME=RIFAT, SUFFIX=FIX
 SEGNAME=RIFAT, SEGTYPE=S0
  FIELDNAME=ROOT, ALIAS=ROOT, FORMAT=A1, ACTUAL=A1, $
 SEGNAME=VALS, PARENT=RIFAT, OCCURS=VARIABLE
  FIELDNAME=TR, ALIAS=TR, FORMAT=A12, ACTUAL=A12, $
  FIELDNAME=VR, ALIAS=VR, FORMAT=A20, ACTUAL=A20, $
  FIELDNAME=CNTR, ALIAS=ORDER, FORMAT=I2, ACTUAL=I4,$

This is a MASTER for a variable length sequential file. There is a fixed part and a variable part.
Here the fixed part is segment RIFAT. It has only 1 field ROOT.
The variable part is the segment VALS. It has 2 real fields TR and VR. This segment OCCURS a variable number of times and WebFOCUS knows how to calculate how many times.
Hence you can add as many pairs of titles and values as you want.
The third field is a virtual one and holds the occurence number of each occurence. That is why I sort with it.

Regards,


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Guru
posted Hide Post
Thanks Daniel for your nice explanation. Good One


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Displaying Columns one after the other???

Copyright © 1996-2020 Information Builders