Message Boards

Different no. of columns fieldnames and values on export

Edward Visser, modified 3 Years ago.

Different no. of columns fieldnames and values on export

Post Date: 7/18/17 (Silver, 44 Posts) Recent Posts

Hi,

Can anyone tell me what causes a difference in no. of columns between a "PUT"-line and an EXPORT-line , although the no. of fields are the same (as far as I can see).

With this code I make an export

Output to "h:\ih_hist 20170719.txt".
PUT "Verkooporder|Klant|Verz.ad|Orderdatum|Benodigd op|Vrv.datum|Opmerking|Betalingsvw|FOB-punt|Inkooporder|Verz via|Deellev OK|VO afdrukken|Factuur|Prijslijst|Verkoper|Herk. order|Commissie|Creditcard|Paklijst afdr|Accoord door|Actiestatus|? (ih__qad01)|? (ih__qad02)|? (ih__qad03)|Kort %|BTW|Vooruitbetaald|Klaar voor fact|Gefact|Db-rek|Kostenpl|Factuurdatum|Verz.datum|BTW J/N|Comment.index|? (ih__qad04)|Gebr1|Gebr2|Valuta|Koers|Taal|Type|Bevestigd op|Revisie|BOL|? (ih__qad05)|PST|FST-ID|Toeslag 1|Toeslag 1|Toeslag 2|Toeslag 2|Toeslag 3|Toeslag 3|Gewicht|Gewicht EH|Grtte|Grtte EH|Colli|Vest|Offerte|BTW-code|? (ih__chr01)|? (ih__chr02)|? (ih__chr03)|? (ih__chr04)|? (ih__chr05)|? (ih__chr06)|? (ih__chr07)|? (ih__chr08)|? (ih__chr09)|? (ih__chr10)|? (ih__dte01)|? (ih__dte02)|? (ih__dec01)|? (ih__dec02)|? (ih__log01)|Credit|Te cred. factuur|Project|PST %|PST-ID|Vrachtlijst|Vervoersvw|Commissie|Verkoper|Vaste koers|Koers|Fact.ad|BOL afdrukken|Gebr-ID|BTW-datum|Kanaal|Facturen via|KS-type|Bank|Min.gewicht|Cat.prijslijst|Belastingomgeving|Aard trans|Contract|Creditprijslijst|Monteur verz.adr|Annulering|Verbruik/Vervang|Gepland|Vaste prijs|Schema via|Melding|Tariefcode|Laatst aangepast op|Datum prijs|Dat ltst prijs|Voorraadkosten|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|QAD veld|Primaire VO|IO eindgebruiker|Secundaire EMT-order|IO verz|Koers 2|Type koers|Divisie|Volgorde|Batch|Datum export|Tijd export" SKIP.
FOR EACH ih_hist WHERE ih_inv_nbr = "SI354032" OR ih_inv_nbr = "SI354033" NO-LOCK :
    EXPORT
        DELIMITER "|"
        ih_nbr ih_cust ih_ship ih_ord_date ih_req_date ih_due_date ih_rmks ih_cr_terms ih_fob ih_po ih_shipvia ih_partial ih_print_so ih_inv_nbr ih_pr_list ih_xslspsn ih_source ih_xcomm_pct ih_cr_card ih_print_pl ih_cr_init ih_stat ih__qad01 ih__qad02 ih__qad03 ih_disc_pct ih_tax_pct ih_prepaid ih_to_inv ih_invoiced ih_ar_acct ih_ar_cc ih_inv_date ih_ship_date ih_taxable ih_cmtindx ih__qad04 ih_user1 ih_user2 ih_curr ih_ex_rate ih_lang ih_type ih_conf_date ih_rev ih_bol ih__qad05 ih_pst ih_fst_id ih_trl1_amt ih_trl1_cd ih_trl2_amt ih_trl2_cd ih_trl3_amt ih_trl3_cd ih_weight ih_weight_um ih_size ih_size_um ih_cartons ih_site ih_quote ih_taxc ih__chr01 ih__chr02 ih__chr03 ih__chr04 ih__chr05 ih__chr06 ih__chr07 ih__chr08 ih__chr09 ih__chr10 ih__dte01 ih__dte02 ih__dec01 ih__dec02 ih__log01 ih_credit ih_inv_cr ih_project ih_pst_pct ih_pst_id ih_fr_list ih_fr_terms ih_comm_pct ih_slspsn ih_fix_rate ih_ent_ex ih_bill ih_print_bl ih_userid ih_tax_date ih_channel ih_inv_mthd ih_fsm_type ih_bank ih_fr_min_wt ih_pr_list2 ih_tax_env ih_tax_usage ih_sa_nbr ih_crprlist ih_ship_eng ih_cncl_date ih_conrep ih_sched ih_fix_pr ih_sch_mthd ih_ca_nbr ih_fcg_code ih_mod_date ih_pricing_dt ih_priced_dt ih_rstk_pct ih__qadc01 ih__qadc02 ih__qadc03 ih__qadc04 ih__qadc05 ih__qadt01 ih__qadt02 ih__qadt03 ih__qadd01 ih__qadd02 ih__qadd03 ih__qadi01 ih__qadi02 ih__qadi03 ih__qadl01 ih__qadl02 ih__qadl03 ih_primary ih_cust_po ih_secondary ih_ship_po ih_ex_rate2 ih_ex_ratetype ih_div ih_exru_seq ih_export_batch ih_export_date ih_export_time.
END.
OUTPUT CLOSE.

The no. of fields in both lines (PUT and EXPORT) is exactly the same, but in my .txt-file there are 25 (!) columns more in the detail-line than in the PUT-line.

Can someone please explain this to me? First I thaught of CHR(10) or CHR(13) behaviour, but this can't be it, because the line do not break at a certain point and continue on the next row.

Many thanks in advance,

Edward

John Ruch, modified 8 Years ago.

Re: Different no. of columns fieldnames and values on export

Post Date: 7/19/17 (Silver, 64 Posts) Recent Posts

Look for variables that are arrays with extents - ih_comm_pct[4] will export as 4 columns.

-John

Edward Visser, modified 8 Years ago.

Re: Different no. of columns fieldnames and values on export

Post Date: 7/19/17 (Silver, 44 Posts) Recent Posts

Why didn't I think of that. Already thaught it would be something like that, but didn't exactly have in sight what the array variables were per table. At the end of the export of the records there were some empty fields, so I was a little mislead for the number of columns I was missing. Now made an export with a "data type"-row, so could exactly move the fields to the right if there was an array and it matches perfectly now. Thanks so much!

Message place holder