× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello.

I'm eval'ing a data structure (LikeRec) to another data structure, but
there are fields in the first DS that aren't in the second but everything
works just fine. My understanding was that this should not work correctly
without eval-corr. The original code deleted the record and then replaced
it, but now we need to keep the first date that the record was added. The
file has a lot of fields and I really didn't want to eval every single one
of them after the chain so I thought I'd go with the LikeRec keyword and
eval-corr. I realized when I compiled that eval-corr wasn't available to
me but like I said, it still seems to work great. Unfortunately, I don't
know why it works and that bothers me.... Here's the code: (sorry it's
not in /free but this is ugly maintenance work =).

FPMPCONV IF E DISK
F RENAME(RF$PM:PMPCNV)
FPM UF A E K DISK


#4595D saveDS DS LikeRec(PMPCNV:*input)
#4595D toDS DS LikeRec(RF$PM:*output)
D ERM S 80 DIM(2) CTDATA PERRCD(1)
#4595D TEMP_DATE S LIKE(PMDENT)
C *ENTRY PLIST
C PARM PRFILE 12
C Z-ADD *ZERO ADDCNT 7 0
C Z-ADD *ZERO RPLCNT 7 0

#4595C READ PMPCONV saveDS
#4595C DOW not %eof(PMPCONV)
C EXSR UPMSR
#4595C READ PMPCONV saveDS
C ENDDO
C MOVE *ON *INLR

C UPMSR BEGSR
#4595C saveDS.PMPART CHAIN RF$PM
#4595C IF %FOUND(PM)
#4595C EVAL TEMP_DATE = PMDENT
#4595C DELETE RF$PM
#4595C EVAL toDS = saveDS
#4595C EVAL toDS.PMDENT = TEMP_DATE
#4595C EVAL toDS.PMDMNT =
%dec((%editc(saveDS.PMADM:'X') // these two fields do not exist
#4595C + %editc(saveDS.PMADY:'X')):6:0) //
in the toDS
C MOVEL(P) ERM(1) ERRMSG 80
C ADD 1 RPLCNT

C ELSE
C MOVEL(P) ERM(2) ERRMSG 80
#4595C EVAL toDS = saveDS
#4595C EVAL toDS.PMDENT =
%dec((%editc(saveDS.PMADM:'X')
#4595C + %editc(saveDS.PMADY:'X')):6:0)
C ADD 1 ADDCNT
C ENDIF

#4595C WRITE RF$PM toDS

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.