I was on my phone, now on my laptop. I tried a simple Test of Group Deep Assign 2 ways: Prop:Record or passing *GROUP. Both fail. I would suggest you work out your code with a small program like this that looks at one record and a few fields:
PROGRAM
Service1 FILE,DRIVER('TOPSPEED'),RECLAIM,PRE(SER1), BINDABLE,CREATE,THREAD
Record RECORD,PRE()
ID LONG
Desc STRING(20)
Date DATE
END
END
Service2 FILE,DRIVER('TOPSPEED'),RECLAIM,PRE(SER2), BINDABLE,CREATE,THREAD
Record RECORD,PRE()
ID LONG
Desc STRING(20)
Date LONG
END
END
MAP
CopyTPS2SQL PROCEDURE (FILE pTPS,FILE pSQL, *GROUP pTPS_Group , *GROUP pSQL_Group)
END
CODE
CLEAR(Service1)
Ser1:Desc='Hello ' & Today()
Ser1:Date=today()
CopyTPS2SQL(Service1,Service2, SER1:Record, SER2:Record)
! ! SER2:Record :=: SER1:Record !Test 4 this always works
Message('Ser1:Desc=' & Ser1:Desc &'|Ser2:Desc=' & Ser2:Desc & |
'||Ser1:Date=' & Ser1:Date &'|Ser2:Date=' & Ser2:Date,'Deep Assign Record' )
RETURN
!----------------------------
CopyTPS2SQL PROCEDURE (FILE pTPS,FILE pSQL, *GROUP pTPS_Group , *GROUP pSQL_Group)
pTPSRecord &GROUP
pSQLRecord &GROUP
CODE
pTPSRecord &= pTPS{PROP:Record}
pSQLRecord &= pSQL{PROP:Record}
pSQLRecord :=: pTPSRecord !Test 1: Prop:Record Assign
! pSQL_Group :=: pTPS_Group !Test 2: Passed *GROUP
!Below works but not if record is different. Good to see works somewhat
! pSQL_Group = pTPS_Group !Test 3: Assume same record
RETURN
The Help says Deep Assign is done by the Compiler. I thought it could be done it at Runtime but the above code confirms it cannot, unless I have a bug.
Maybe someone else has some ideas as it is fairly common to want to convert all files from TPS to SQL, and fairly common to change some fields especially date/time. Post a new Question about TPS to SQL, and changing record fields. Search here as it probably already exists. I know Clarion Mag has some articles on converting TPS to SQL. Also check ClarionLive.com
I would write a Utility Template to generate code like you found worked for every file. That may already exist. You can take that code and change it for individual files and fields. Note I think you had a field different ExpiryDate <> UserExpiryDate.