Unable to show complete value in report.

There is a field problem-desc in database table and data type is char with format x(30). But this is holding the value more than 30 in length.For example there is a value in this field -
"[FONT=&quot]loaddb swt/orcdrstatus.p : No product history (csm-productHistory) record for CPS call[/FONT]"

Similar to this there are many records and i want to send these values in a txt file.So below is the small part of the code written for same -

Temp table defination -
define temp-table tt-clicarrier
rcode-information
field cli as character label "CLI"
field carrier as character label "Carrier"
field errordesc as character label "Problem Desc"
field t-week as integer label "No. within week"
field t-month as integer label "No. within month"
field t-2month as integer label "No. within 2 months"
field t-3month as integer label "No. within 3 months"
field t-total as integer label "Total"
field l-first as date initial today label "First" format "99/99/9999"
field l-last as date initial 01/01/01 label "Last" format "99/99/9999"
field availserv as character label "On System"
field t-hmnl as character label "HM-NL"
index ix-main
cli
carrier
errordesc.

-----some code---
-------
Assignment to lc-pdesc -

assign lc-pdesc = if fr-load-errors.problem-desc begins 'Duplicate CDR'
then substring(fr-load-errors.problem-desc,1,20)
else if fr-load-errors.problem-desc begins 'sweep to
one' then substring(fr-load-errors.problem-desc,21,30)
else if fr-load-errors.problem-desc begins 'loaddb' then
substring(fr-load-errors.problem-desc,28,30)
else if fr-load-errors.problem-desc begins 'DayOfBillSplit'
then substring(fr-load-errors.problem-desc,33,30)
else substring(fr-load-errors.problem-desc,1,100).

Creation of temp table in program -

create tt-clicarrier.
assign tt-clicarrier.cli = fr-load-errors.orig-service
tt-clicarrier.carrier = fr-load-errors.data_source
tt-clicarrier.availserv = 'On System' when not lc-subproblem
matches '*Not available csm-service*'
tt-clicarrier.errordesc = lc-pdesc
tt-clicarrier.t-hmnl = lc-hmnl.

Sending temp table output to text file-


for each tt-clicarrier:
export delimiter '|' tt-clicarrier.
end.
output close.

My Query


In text file i am getting the output "[FONT=&quot]No product history (csm-produc" [/FONT]
instead of complete message which is [FONT=&quot]"loaddb swt/orcdrstatus.p :[/FONT][FONT=&quot] No product history (csm-produc[/FONT][FONT=&quot]tHistory) record for CPS call[/FONT]".
I am not able to understand why complete message is not going into text file.

Could you please help me to send complete message into the text file.

Thanks
 

LarryD

Active Member
A couple of different ways, but the simplest may be to change the temp-table description.

field errordesc as character label "Problem Desc" format "x(###)"

where the ### is whatever the maximum number of characters you are expecting.
 
Hi,

Thanks for the quick reply.

I tried to change the temp-table definition in following way -

define temp-table tt-clicarrier
rcode-information
field cli as character label "CLI"
field carrier as character label "Carrier"
field errordesc as character format 'x(100)' label "Problem Desc"
field t-week as integer label "No. within week"
field t-month as integer label "No. within month"
field t-2month as integer label "No. within 2 months"
field t-3month as integer label "No. within 3 months"
field t-total as integer label "Total"
field l-first as date initial today label "First" format "99/99/9999"
field l-last as date initial 01/01/01 label "Last" format "99/99/9999"
field availserv as character label "On System"
field t-hmnl as character label "HM-NL"
index ix-main
cli
carrier
errordesc.

But this threw the error like "field size is more than index limit", i dont remember the exact error message. So, please suggest me if your solution will still work in this case?
 

rusguy

Member
In versions of Progress prior to 10.1b the total length of fields in the index should be less than 200 characters. Remove errordesc field from the index of a temp-table and you should be good to go.
 
Thanks for this information.

With reference to my original query, please let me know one more query that the original string in the variable is stored "loaddb swt/orcdrstatus.p : No product history (csm-productHistory) record for CPS call" but only the string "No product history (csm-produc" is going into the text file.

My query here is that why is starting characters(loaddb swt/.....) are being skipped? Is there any particular reason?
 

LarryD

Active Member
it's right there in your code, only putting out 30 characters starting in position 28 for 30 characters:

else if fr-load-errors.problem-desc begins 'loaddb' then
substring(fr-load-errors.problem-desc,28,30)

Not to sound preachy or condescending, but if you are trying to read 4GL/ABL code without any training, I'd highly suggest you look into taking a Progress ABL programming class or two from Progress or one of the other fine companies/consultants that offer that service. There are also some very good beginner's books (John Campbell's comes to mind, although there are sure to be others including some from Progress), and I believe there are online courses also offered.
 
Hi,

As per your suggestion i used Format 'x(###)' to display complete data but throwing error -"Value can not be displayed using Format 'x(###)'".

Please suggest me in this case.

TIA
 

StuartT

Member
Hi,

As per your suggestion i used Format 'x(###)' to display complete data but throwing error -"Value can not be displayed using Format 'x(###)'".

Please suggest me in this case.

TIA

format 'x(###)' was not meant to be taken literally, you should substitute a number for the ###, eg format 'x(120)' or format 'x(170)', etc
 
Top