Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to remove the preceding Numbers from the original values
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] How to remove the preceding Numbers from the original values
 Login/Join
 
Silver Member
posted
Hi Everyone

I need to get the data from the table and try write the data in the file.

But file created successfully with out any issues. I did not get the exact value from the table. Data is mismatch now.

For Example:

If the data in the table looks like "1105" but in the file data will have "0000041105" look like.

How to resolve this issue ?


Thanks in advance

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
 
Posts: 35 | Registered: February 17, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You'll have to show us what your report looks like. Can you give us an example of what you're doing in the FOCUS code?

If you're in InfoAssist, click the magnifying glass on the top to see the actual code, copy and paste it here so we can see what's happening.


WebFOCUS 8206, Unix, Windows
 
Posts: 1660 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
Turn VARCHAR off, or DEFINE the column as A4


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1946 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Silver Member
posted Hide Post
This is the .Fex I am using

-* Fetch the record from the QAD_VD_MSTR
TABLE FILE QAD_JFRA_VD_MSTR
PRINT VD_ADDR VD_CR_TERMS VD_CURR VD__LOG01 VD_TYPE
ON TABLE SAVE AS QAD_JFRA_VD_MSTR_INFO
END
-RUN

-* Assign the variable values
-SET &VD_MSTR_NO_RECS = &RECORDS;
-SET &DATA_ROW_VD_MSTR = '';

-* Change the File attribute from Overwrite to Append
FILEDEF FILE_VD_MSTR DISK /ETL/app/dm/dev/ibi/apps/vedw_test/smtp_test/vd_mstr.ftm (APPEND
-RUN

-* Make the Loop to get all the records from the table
-REPEAT VD_MSTR_ROWS &VD_MSTR_NO_RECS TIMES
-READ QAD_JFRA_VD_MSTR_INFO &VD_ADDR.A80 &VD_CR_TERMS.A80 &VD_CURR.A30 &VD__LOG01.I11 &VD_TYPE.A30
-SET &VDADDR = TRUNCATE(&VD_ADDR);
-SET &VDCRTERMS = TRUNCATE(&VD_CR_TERMS);
-SET &VDCURR = TRUNCATE(&VD_CURR);
-SET &VDLOG01 = &VD__LOG01;
-SET &VDTYPE = TRUNCATE(&VD_TYPE);

-*-TYPE &VDADDR &VDCRTERMS &VDCURR &VDLOG01 &VDTYPE

-* Concatenate all the column values and write the file
-SET &DATA_ROW_VD_MSTR = &VDADDR || &DELIMIT || &VDCRTERMS || &DELIMIT || &VDCURR || &DELIMIT || &VDLOG01 || &DELIMIT || &VDTYPE;
-WRITE FILE_VD_MSTR &DATA_ROW_VD_MSTR



Please help me....


WebFOCUS 8
Windows, All Outputs
 
Posts: 35 | Registered: February 17, 2017Reply With QuoteReport This Post
Silver Member
posted Hide Post
quote:
Originally posted by BabakNYC:
You'll have to show us what your report looks like. Can you give us an example of what you're doing in the FOCUS code?

If you're in InfoAssist, click the magnifying glass on the top to see the actual code, copy and paste it here so we can see what's happening.



This is the .Fex I am using

-* Fetch the record from the QAD_VD_MSTR
TABLE FILE QAD_JFRA_VD_MSTR
PRINT VD_ADDR VD_CR_TERMS VD_CURR VD__LOG01 VD_TYPE
ON TABLE SAVE AS QAD_JFRA_VD_MSTR_INFO
END
-RUN

-* Assign the variable values
-SET &VD_MSTR_NO_RECS = &RECORDS;
-SET &DATA_ROW_VD_MSTR = '';

-* Change the File attribute from Overwrite to Append
FILEDEF FILE_VD_MSTR DISK /ETL/app/dm/dev/ibi/apps/vedw_test/smtp_test/vd_mstr.ftm (APPEND
-RUN

-* Make the Loop to get all the records from the table
-REPEAT VD_MSTR_ROWS &VD_MSTR_NO_RECS TIMES
-READ QAD_JFRA_VD_MSTR_INFO &VD_ADDR.A80 &VD_CR_TERMS.A80 &VD_CURR.A30 &VD__LOG01.I11 &VD_TYPE.A30
-SET &VDADDR = TRUNCATE(&VD_ADDR);
-SET &VDCRTERMS = TRUNCATE(&VD_CR_TERMS);
-SET &VDCURR = TRUNCATE(&VD_CURR);
-SET &VDLOG01 = &VD__LOG01;
-SET &VDTYPE = TRUNCATE(&VD_TYPE);

-*-TYPE &VDADDR &VDCRTERMS &VDCURR &VDLOG01 &VDTYPE

-* Concatenate all the column values and write the file
-SET &DATA_ROW_VD_MSTR = &VDADDR || &DELIMIT || &VDCRTERMS || &DELIMIT || &VDCURR || &DELIMIT || &VDLOG01 || &DELIMIT || &VDTYPE;
-WRITE FILE_VD_MSTR &DATA_ROW_VD_MSTR


WebFOCUS 8
Windows, All Outputs
 
Posts: 35 | Registered: February 17, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Could you also explain what you're attempting to do? I have a feeling you're using Dialogue Manager when you should actually use TABLE which might be much easier.


WebFOCUS 8206, Unix, Windows
 
Posts: 1660 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
The leading six digits is the actual length of the data: VARCHAR

So, for 1105, with VARCHAR ON, the value is 0000041105
For 123456789, its 000009123456789.

To fix, TURN VARCHAR OFF, or,
DEFINE FILE TABLENAME
NEW_COL/A9 = varchar_9_column
END

then TABLE FILE out NEW_COL.

You can try ON TABLE HOLD AS QAD_JFRA_VD_MSTR_INFO FORMAT ALPHA

Basic Stuff...


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1946 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
Once try, this by keeping a command
"on table set holdlist printonly"


WebFOCUS 7.X.X, 8.X.X
Windows, All Outputs
 
Posts: 74 | Registered: February 02, 2016Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] How to remove the preceding Numbers from the original values

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.