Focal Point
[CLOSED] How to remove the preceding Numbers from the original values

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

April 05, 2017, 07:59 AM
Kalai
[CLOSED] How to remove the preceding Numbers from the original values
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
April 05, 2017, 08:12 AM
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.


WebFOCUS 8206, Unix, Windows
April 05, 2017, 08:37 AM
Tom Flynn
Turn VARCHAR off, or DEFINE the column as A4


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
April 05, 2017, 11:03 AM
Kalai
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
April 06, 2017, 05:53 AM
Kalai
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
April 06, 2017, 09:04 AM
BabakNYC
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
April 06, 2017, 09:50 AM
Tom Flynn
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 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
April 06, 2017, 12:44 PM
pav
Once try, this by keeping a command
"on table set holdlist printonly"