× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Greetings,

I am trying out CGIDEV2 for the first time to generate XML. I am having issues with certain elements showin ***Missing Data*** instead of the actual field value. I know have value filled in field because during debug I see the value.

Here is the code:

XML Template
<! -- Sec_FileHeader -->
<Tools1>
<! -- Sec_CategoryHeader -->
<Category>
<CategoryCode>/%CatCode%/</CategoryCode>
<CategoryName>/%CatName%/</CategoryName>
<! -- Sec_ProductDataMain1 -->
<Product>
<ProductCode>/%ProdCode%/</ProductCode>
<ShortDescription>/%ShortDesc%/</ShortDescription>
<! -- Sec_ProductDataOption1 -->
<LongDescription>/%FullDesc%/</LongDescription>
<! -- Sec_ProductDataMain2 -->
<SellPrice>/%SellPrice%/</SellPrice>
<DiscPrice>/%DiscPrice%/</DiscPrice>
<QuantityOnHand>/%QtyOnHand%/</QuantityOnHand>
</Product>
<! -- Sec_FileTrailer -->
</Category>
</Tools1>

RPG Code
H dftactgrp(*no)
*-/copy: H specifications, for copy -*
h/COPY QRPGLESRC,HSPECS
*-/copy: H specification for binding directories -*
h/COPY QRPGLESRC,HSPECSBND

d masterProductData...
d e ds extname(DBPRODPF)
d detailProductData...
d e ds extname(DBPDTLPF)

s* ------------------------------------
s* | Product DATA STRUCTURE |
s* ------------------------------------
d dsProductData...
d ds
d productCode like(ino)
d shortDesc like(idesc)
d longDesc like(idescu)
d charSellPrice 10
d* sellPrice like(sPrice)
d discPrice like(sprsp)
d qtyOnHand like(sinv)

s* -----------------------------
s* | COPYBOOKS |
s* -----------------------------
*-Program Data Structure-*
D/COPY QRPGSRC,XACPY00001
*-CGIDEV2 Copybook-*
D/COPY QRPGLESRC,prototypeb
*-COMMON STRUCTURE FOR ERROR CODE PARAMETER CopyBook-*
D/COPY QSYSINC/QRPGLESRC,qusec
s*

s********************************************************************
s* TESTCGIDEV : 'S ' GLOBAL VARIABLES *
s********************************************************************
d itemNumber s like(productCode)
d inz('000010414')


d XML_Output s 256a varying
d inz('/home/ADUARTE/CGIDEV2/+
d products.xml')

d rc s 10i 0

d noDataString c 'No Data'

D* --------------------------------------------------
D* Prototype for program: deleteGLAcct
D* --------------------------------------------------
D testCGIDEV PR extpgm('TESTCGIDEV')

D testCGIDEV PI

s********************************************************************
s* *MAIN* Delete GL Account *
s********************************************************************
/FREE
EXEC SQL
SET OPTION COMMIT = *NONE,
DATFMT = *ISO;

//Initialize subprocedure values
exsr sr_Init;

exsr sr_getProduct;

updHTMLvar('CatCode' :'01' :'0');
updHTMLvar('CatName' :'Test CGIDEV2');
wrtsection('CategoryHeader') ;

updHTMLvar('ProdCode' :'123456789' :'0');
updHTMLvar('ShortDesc' :shortDesc :'0');
wrtsection('ProductDataMain1') ;

if longDesc <> *blanks;
updHTMLvar('FullDesc' :longDesc :'0');
wrtsection('ProductDataOption1') ;
endif;

updHTMLvar('SellPrice' :'123.45' :'0');
updHTMLvar('DiscPrice' :'120.00' :'0');
updHTMLvar('QtyOnHand' :%char(qtyOnHand) :'0');
wrtsection('ProductDataMain2') ;


//wrtSection('CategoryTrailer');
//write trailer
wrtSection('FileTrailer');
rc = WrtHtmlToStmf(XML_Output :819);

*inlr = *on;

//**********************************************************************
//** S U B R O U T I N E S
//**********************************************************************
begsr sr_Init;

getHTMLIFS('/home/ADUARTE/CGIDEV2/ProductTemplate1.xml'
:'<! -- Sec_' :' -->');
wrtSection('FileHeader');

endsr;
//----------------------------------


//----------------------------------
begsr sr_getProduct;

EXEC SQL
SELECT ino, idesc, idescu, sprice, sprsp, sinv
INTO :dsProductData
FROM DBPRODPF
JOIN DBPDTLPF ON DBPRODPF.ino = DBPDTLPF.sitem
WHERE ino = :itemNumber and slocn = '0080' ;

// charSellPrice = %char(sellPrice);

endsr;

Output
<Tools1>
<Category>
<CategoryCode>01</CategoryCode>
<CategoryName>Test CGIDEV2</CategoryName>
<Product>
<ProductCode>**Missing Data**</ProductCode>
<ShortDescription>CALL, TURKEY V MOUTH DIAPHRAGM</ShortDescription>
<LongDescription>CALL, TURKEY V MOUTH DIAPHRAGM</LongDescription>
<SellPrice>**Missing Data**</SellPrice>
<DiscPrice>**Missing Data**</DiscPrice>
<QuantityOnHand>0</QuantityOnHand>
</Product>
</Category>
</Tools1>


Thank you for your assistance.
Art Duarte
[data:%3c;base64,R0lGODlhngAkAPcAAApksWWdzu30+aXG4vf6/VqWy4Wy2Hmq1azK5eTu9/r8/jF8vkWJxNHi8Axlsi15vD2EwV2Yy2CazBBoswBdrqHE4cXa7ZK63E6OxuLs9ghisfj7/X2s1TR+vxZqtVGRyLbQ6LjS6UCGw5i+3nao04Cu1/3+/om02rnT6bzU6h9wuPT4+xdstQZhsHCl0jeAv8jc7vz9/oy22p7C4TmCwCFyuL7W60mMxRpttqDD4fr8/VSSyd7q9ejw+LLO5/H2++ry+Ch2u6jI49vo9CJyuXOm0pS73QpksglisRFmspW83dbl8rTQ5+zz+WKczcPY7MHY69zo9Cd2uqrJ5KvK5dro87vU6ZzA4H2s1g1mso6426/M5bTP50eKxTiBwMzf76/M5s3g71aUyqnI5IKv1xhstW2i0H6u1iR0ukyOxmifzyt4vJvA32+k0fD1+nur1XOn00KHwwRgrzyDwcve7mmg0ODr9dDh8Pb5/NTk8sDX67zU6QBZrIiz2eDs9TZ/wNXk8USIw5C422mgzx1wt+bv97HO5yt4uzaAv1CQyObw+EyMxSR0uW6j0cfc7cbb7RJos0yNxrfR6BxutwBUqafH4ziCwBZqtpq/3xlutnus1eLt9RRptEOIwyZ1ujB7vQpjsY232xNqtHip1G+j0gxlsSJ0uS57vR9xuBhsthputhRqtPP3+xhtthNptBZrtRVqtA9nsw5mshltt8HY7BJotNjm8/7+/87g8PT4/BVqtc/h8Nnn8wlksfL3+2yh0PX5/P7//w5ms/P4+xFos9fm8g1lshJptBtutn6t1hRqtfX4/BtutxVrtOfw963L5Rlstg9msg9ms9rn883g8OHs9snd7urx+Bxvt/n8/fT3/LDN5s/g8P7+/rv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CrYDHcGCPxYXRMhSAHBMkLmqEkQMkaCU/NUqKiMUaCqvBODE2E5EsLTLAsHsj8wE0QywowK3qTNBPSfc]


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.