Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 28 Mar 2003 @ 14:30:54 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Question: Extract OUTMOD
 
From:   Anomy Anom

<-- Anonymously Posted: Friday, March 28, 2003 09:23 -->

First thanks to Wayne for sharing this OUTMOD. How would one modify this outmode to strip the leading two characters in the pointer out_dtl_ptr that are generated by a variable width export?

Taken from www.teradataforum.com/attachments/a030320e.txt

     case 3:

       /* Process data */

           Record_Size=*resplen;
           File_Size=Record_Size+1;     /* need newline character added
to end for UNIX  */

           *resplen = 0;

           /* create the output file */

           memcpy(out_dtl_ptr->FIELD1,resprec->FIELD1, Record_Size);
           out_dtl_ptr->FIELD1[Record_Size] = '\n';

           /* Write output record to disk */

           if ( fwrite(out_dtl_ptr,File_Size,1,file1_fp)
                != NUM_OF_RCDS_WRITTEN )
            {
             fprintf(stderr,"%s %d:Bad Write on file <%s>,errno=%d\n",
             __FILE__,__LINE__,fname,errno);

             perror(fname);
             fflush(stderr);
             dw_kill_parnt_child();
             exit(BAD_WRITE);
            }

           tot_record_ctr++;

     break;

Thanks in advance.



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023