Hello,
I am pasting my code that is necessary, I am taking parsed XML data structure from parseExtendercompanyRequest procedure and trying to pass fields that are necessary to populate File1 Data structure.
I would like to know 1)does EVAL-CORR work correctly to extract the 7 fields into partFile1 ds in extractExtendercompanyRequest procedure? am I missing anything?
2) does populatecompanyMaster procedure receive this 7 fields DS and populate File1 Datastructure?
assumptions are made that XML DS(company_Template) is defined correctly. and all other prototype definitions.
My NOMAIN module is as below :
-------------------------------------------------------------------------------
fFile1 uf a e k disk infds(File1FileDs) usr
f commit(File1_commit)
d dsiFile1 e ds extName(File1:*input) inz
d qualified
----------------------------------------------------------------------------------
p extractExtendercompanyRequest...
p b Export
d extractExtendercompanyRequest...
d pi Like(*inLR)
d eClientNo like like(dsFile1_Template.cltkyh)
d eBranchCode like (dsFile1_template.combrh)
d eProductCode like (dsFile1_template.comtyh)
d XMLfile 1000a const varying Options(*Trim)
d ecompanyNo like (dsFile1_template.qtenoh)
d dsRequest ds LikeDS(company_Template) dim(999)
d resFile1 likeds(partFile1_Template) inz
d dsoFile1 likeds(dsFile1_Template)
d p_errorDS LikeDS(dsCccErrorInfo_Template)
*;
if parseExtendercompanyRequest(XMLfile:dsRequest:
p_errorDS) = *on;
p parseExtendercompanyRequest...
p b Export
d parseExtendercompanyRequest...
d pi Like(*inlr)
D company likeds(company_Template) dim(999)
D xmlfile 1000A const varying Options(*Trim)
d p_errorDS LikeDS(dsCccErrorInfo_Template)
*;
/Free
xml-into company %xml(xmlfile:
'case=any +
allowextra=yes +
allowmissing=yes');
// report errors in parsing
if %error() ;
pErrorDS.error = *on ;
doError('XYZ0002':pErrorDS);
return *off ;
endif ;
else;
return *on;
endif;
/End-Free
p e
p populatecompanyMaster...
p b Export
d populatecompanyMaster...
d pi Like(*inLR)
d eClientNo like (dsFile1_Template.cltkyh)
d eBranchCode like (dsFile1_template.combrh)
d eProductCode like (dsFile1_template.comtyh)
d ecompanyNo like (dsFile1_template.qtenoh)
d reqFile1 likeds(partFile1_Template) inz
d dsiFile1 e ds extName(File1:*input) inz
d qualified
d dsoFile1 e ds extName(dsFile1_Template) const
d
d p_errorDS LikeDS(dsCccErrorInfo_Template)
*;
chain(en) (eClientNo:eBranchCode:eProductCode) File1 dsiFile1;
if %found(File1) and not %error;
eval-corr dsoFile1 = reqFile1;
==============================================================================================
My prototype definitions are as below
/if not defined (comFile1p)
/define comFile1p
d company_Template...
d ds qualified based(dummy_ptr)
d brands likeds(brands_Template)
d companysource likeds(companysource_Template)
d contact likeds(contact_Template)
d companyrisk likeds(companyrisk_Template)
d
d brands_Template...
d DS qualified
d brand likeds(brand_Template) DIM(999)
d brand_Template DS qualified
d name 100a
d branchcode 2a
d productcode 3a
d name_Template ds qualified
d title 20a
d firstname 35a
d lastname 35a
d companyrisk_Template...
d DS QUALIFIED
d companyrisk_Template...
d DS QUALIFIED
d startdate 8p 0
and a lot to continue....
From above XML
d dsrFile1_Template ds qualified
d combrh like(company_Template.brand_Template.branchcode)
d const
d comtyh like(company_Template.brands_Template.brand_Template.productcode)
d const
d pqrm1h like(company_Template.contact_Template.name_Template.firstname)
d const
d pqrm2h like(company_Template.contact_Template.name_Template.lastname)
d const
d ncipth like(company_Template.companyrisk_Template.startdate)
d const
d nincph like(company_Template.companyrisk_Template.startdate)
d const
d pbsqth like(company_Template.companyrisk_Template.bestprice)
d const
company/companyrisk/bestprice
------------------------------------
My file data structure....
d dsFile1_Template ds
---------------------------
d partFile1_Template ds qualified
d combrh like(company_Template.brand_Template.branchcode)
d const
d comtyh like(company_Template.brands_Template.brand_Template.productcode)
d const
d pqrm1h like(company_Template.contact_Template.name_Template.firstname)
d const
d pqrm2h like(company_Template.contact_Template.name_Template.lastname)
d const
d ncipth like(company_Template.companyrisk_Template.startdate)
d const
d nincph like(company_Template.companyrisk_Template.startdate)
d const
d pbsqth like(company_Template.companyrisk_Template.bestprice)
d const
As an Amazon Associate we earn from qualifying purchases.
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.