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     [CLOSED] How to calculate FILEDEF LRECL for variable length fields

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to calculate FILEDEF LRECL for variable length fields
 Login/Join
 
Master
posted
I have a master file in which a few fields are defined as variable length ( e.g., A3V).
This is unusable, however, as the data is still being loaded from an oracle warehouse.
Regardless, I am creating a report with these fields (and their formats) and made-up data.

I have created a MFD with -WRITE, like this:

 
SET HOLDLIST=PRINTONLY
-RUN

FILEDEF MASTER DISK labelf.mas
-RUN

-WRITE MASTER FILENAME=LABELF, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=LABELF, $
-WRITE MASTER FIELDNAME=LABELN, FORMAT=I4, ACTUAL=A4, $
-WRITE MASTER FIELDNAME=FILLER, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=LABELA, FORMAT=A2, ACTUAL=A2V, $

-SET &XLEN = ?? ;

FILEDEF LABELF DISK LABELF.txt (LRECL &XLEN RECFM V
-RUN

-WRITE LABELF 0001 A
-WRITE LABELF 0002 B
-WRITE LABELF 0003 C
-WRITE LABELF 0004 D
-WRITE LABELF 0005 E

 -RUN

-EXIT


My question is, do I code the LREC by totaling up the FORMAT values, or the
ACTUAL values?

Thanks,

This message has been edited. Last edited by: <Kathryn Henning>,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Expert
posted Hide Post
  
APP FILEDEF MASTERNAME DISK Drive:\ibi\apps\FOLDER\LABELF.txt
-RUN
CHECK FILE MASTERNAME HOLD
-EXIT

Generates:
  
 0 NUMBER OF ERRORS=     0
 NUMBER OF SEGMENTS=   1  ( REAL=    1  VIRTUAL=   0 )
 NUMBER OF FIELDS=     1  INDEXES=   0  FILES=     1
 TOTAL LENGTH OF ALL FIELDS=  197


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Master
posted Hide Post
thanks Tom. I have been working on this and it looks like I may not need to account for the A3V etc., fields in my mfd created by -WRITE.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
<JG>
posted
Tomsweb

You do need to accomodate the variablility.

Each variable length field adds 6 bytes to the saved data when you go from
a relational source to a flat file or a FOCUS .foc

so Oracle varchar2 (2)

becomes FORMAT=2V ,ACTUAL A2W

WebFOCUS does not use real variable length storage, it holds the physical length of the column
as 6 unreferenced bytes

So when you hold a varchar (2) containing A, it actualy holds 000001A
AB, it actualy holds 000002AB

That means for your example you have an LRECL of 13

4 + 1 + 6 + 2 = 13

Also the ACTUAL is AnW not AnV
Your FORMAT can be either A2 or A2V depending on how you want to use it

FILEDEF MASTER DISK labelf.mas
-RUN

-WRITE MASTER FILENAME=LABELF, SUFFIX=FIX, $
-WRITE MASTER SEGNAME=LABELF, $
-WRITE MASTER FIELDNAME=LABELN, FORMAT=I4, ACTUAL=A4, $
-WRITE MASTER FIELDNAME=FILLER, FORMAT=A1, ACTUAL=A1, $
-WRITE MASTER FIELDNAME=LABELA, FORMAT=A2V, ACTUAL=A2W, $

-SET &XLEN = 13 ;

FILEDEF LABELF DISK LABELF.txt (LRECL &XLEN RECFM V
-RUN

-WRITE LABELF 0001 000001A
-WRITE LABELF 0002 000001B
-WRITE LABELF 0003 000001C
-WRITE LABELF 0004 000001D
-WRITE LABELF 0005 000001E

TABLE FILE LABELF
PRINT *
END
 
Report 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     [CLOSED] How to calculate FILEDEF LRECL for variable length fields

Copyright © 1996-2020 Information Builders