The code I'm having is :

sub rerateandupdate (@) { my $currAcct = shift; my $getAccumsForAcct = qq{ select distinct usage_acum_seq_nbr fro +m svc_price sp,svc_agrmnt_line_item sali,sbscrp_Asgm sa where sp.free +_usage_across_acct_ind in ('Y','A') and sp.svc_name=sali.svc_name and + sp.comm_svc_area_id=sali.comm_svc_area_id and sp.charge_type_cd='F' +and sp.svc_price_expr_dt is null and svc_agrmnt_trmntn_dt is null an +d sali.sbscrp_id=sa.sbscrp_id and sa.sbscrp_asgm_expr_dt is null and +acct_nbr=:currAcct}; my $getAccums = $lda->prepare($getAccumsForAcct); if(defined($getAccums)) { $getAccums->execute(); while (my @accums = $getAccums->fetchrow_array() ) { foreach(@accums) { int returnCode = SUCCESS; my $xmlFile = "GetUsgSummary_" . $acct_nbr . ".xml +"; createXmlForUpd( $xmlFile, $acct_nbr, ); $returnCode = invokeServer( $acct_nbr , $xmlFi +le ); if ( $returnCode != SUCCESS ) { return $return +Code; } return $returnCode; } } } }
sub createXmlForUpd($$) { my $xmlFile = shift; my $acct_nbr = shift; my $returnCode = SUCCESS; # Generate XML API input file for UpdateAccount API open(INFILE,">$xmlFile")||die "Can not find file $xmlFile\n"; print INFILE '<envelope>' . "\n"; print INFILE '<header>' . "\n"; print INFILE '</header>' . "\n"; print INFILE '<body>' . "\n"; print INFILE '<inputGetUsageSummary acctNbr="' . $acct_nbr .'" bil +lUnbilledInd="U" "\n"; print INFILE "</body>\n"; print INFILE "</envelope>\n\n"; close(INFILE); return $returnCode; }
sub invokeServer($$) { my $acct_nbr = shift; my $xmlFile = shift; my $pwd = $ENV{'PWD'}; my $api_call = ${pwd} . "/REAccount1 -stdin < " . $xmlFile; my $cleanup_call = "rm ". $xmlFile; if ($opt_c eq "Y" || $opt_c eq "y") { my $output = `$api_call`; # Execute Unix command } else { print LOG_FILE "[$acct_nbr] NO_GO - XML Input file successfull +y created for acct_nbr = $acct_nbr -> API hasn't been invoked\n"; return SUCCESS; } }

in the subroutine invokeServer,from the 'output' of api call,I need to fetch the values I mentioned in my post and the output of XML api call I already posted.


In reply to Re^2: Fetch field values from API output by rkrish
in thread Fetch field values from API output by rkrish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.