PxPlus User Forum

Twitter Twitter Twitter

Author Topic: COMPARE A FILE WITH HIS DEFINITION IN NOMADS  (Read 1574 times)

bcarminan

  • New Member
  • *
  • Posts: 2
    • View Profile
COMPARE A FILE WITH HIS DEFINITION IN NOMADS
« on: August 30, 2018, 10:31:07 AM »
Hello,

Il want compare a physical file with his definition in nomads.

With the fiels, i have found a way but with the key definitions I don't find a way.

I can read the key definition with "CALL "**key.inf",CH_TRAVAIL,KK$" but I don't find a program for nomads definition.

Is it possible ?

Thanks

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: COMPARE A FILE WITH HIS DEFINITION IN NOMADS
« Reply #1 on: August 30, 2018, 01:34:56 PM »
If all you want to do is match the IOLISTs and file key definitions the easiest solution is to create a new temporary file from the Nomads Data Dictionary definition then compare:

  • FIN(nn,"KEY_DEFINITION")
  • IOL(nn:*)
  • IOL(nn:^) If present
  • IOL(nn:key) If present

To create a temporary file from the dictionary definition use:

CALL "*dict/dd_updt;Update_Physical", table_name$, temporary_file_path$,"",errmsg$
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

bcarminan

  • New Member
  • *
  • Posts: 2
    • View Profile
Re: COMPARE A FILE WITH HIS DEFINITION IN NOMADS
« Reply #2 on: August 31, 2018, 03:51:28 AM »
Yes, it's easy now.

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: COMPARE A FILE WITH HIS DEFINITION IN NOMADS
« Reply #3 on: August 31, 2018, 09:24:52 AM »
One other thing you might consider if using PxPlus 2017 or later is to include OPT="VALIDATE" on the open of the files.  This will then include the validation rules on the file IOLISTs which means even changes such as numeric sizes, field lengths, and validation tables will be compared.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com