×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

File Conversion - combine 2 files preserving data in target file

File Conversion - combine 2 files preserving data in target file

File Conversion - combine 2 files preserving data in target file

(OP)
Hi,

In the file conversion below wish to combine the data from CCData4.tps with that of CCData3.tps - preserving whatever data is already stored in the respective columns of CCData3.tps

This source quoted below removes the data already present in CCData3.tps

  CODE
  SourceName = 'C:\Entw_C5\CCData\cnv\Ccdata4.tps'
  TargetName = 'C:\Entw_C5\CCData\cnv\Ccdata3.tps'

  OPEN(Progress)

  OPEN(CCData4)
  IF ERROR() THEN MESSAGE('Error opening CCData4.tps' & ERROR()); RETURN.
  OPEN(CCData3)
  IF ERROR() THEN MESSAGE('Error opening CCData3.tps' & ERROR()); RETURN.
  SET(CCData3)
  LOOP
    NEXT(CCData3)
    IF ErrorCode() = 33 THEN BREAK.
    CC4:NUMBER = CC3:NUMBER
    GET(CCData4,CC4:Number_Key)
    IF ErrorCode() THEN
      MESSAGE('CCData with No.: '& CC4:NUMBER &' not found').
    CC3:REACHED = CC4:REACHED
    CC3:TRY = CC4:TRY
    CC3:REASON_NB = CC4:REASON_NB
    CC3:REACTION = CC4:REACTION
    CC3:REMARKS = CC4:REMARKS
    PUT(CCData3)
  END
  CLOSE(Ccdata4)
  CLOSE(CCData3)

  CLOSE(Progress)

TIA and kind regards
Karlo

RE: File Conversion - combine 2 files preserving data in target file

if all you want to do is ADD the data to file CCData3 :

                      SET(CCData4,1)            !START WITH CCDATA4
                      LOOP
                        NEXT(CCData4)
                        IF ErrorCode() THEN BREAK.
                        CLEAR(CC3:RECORD)
                        CC3:REACHED = CC4:REACHED
                        CC3:TRY = CC4:TRY
                        CC3:REASON_NB = CC4:REASON_NB
                        CC3:REACTION = CC4:REACTION
                        CC3:REMARKS = CC4:REMARKS
                        ADD(CCData3)
                        IF ERRO() THEN STOP(ERROR()).
                      END
This will create a new CCDATA3 record from the fields shown
from CCdata4.
Is this what you want to do?

Hope it helps.
Joe
                      

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close