Hi All,
When I create JSON files from PxPlus each element terminates with comma+0A.
I note that most JASON files we process from other sources are a continuous stream of data with only a comma between elements.
If I parse the PxPlus file at
https://jsonformatter.org/ is validates OK.
Is this correct for PxPlus or should I be doing something to eliminate the 0A ?
SMPRICE_JSON:
CLEAR SMPRICEJSON${ALL}
LET SMPRICEJSON$["Price Date"]=""
LET SMPRICEJSON$["Products.1.Inventory_SKU"]=""
LET SMPRICEJSON$["Products.1.List_Price"]=""
LET SMPRICEJSON$["Price Date"]=DYMD$
FOR I=1 TO 5
READ RECORD (ICM1)ICM1$
LET SMPRICEJSON$["Products."+STR(I)+".SKU"]=ICM1.STOCK_CODE$
LET SMPRICEJSON$["Products."+STR(I)+".Price"]=STR(ICM1.PRICES[1])
NEXT I
LET SMPRICE$=DIM(LIST EDIT SMPRICEJSON${ALL})
LET JSONFILE$="/hit/temp/czapijson.json";
ERASE JSONFILE$,ERR=*PROCEED;
SERIAL JSONFILE$;
OPEN (HFN,ISZ=LEN(SMPRICE$))JSONFILE$;
WRITE RECORD (LFO)SMPRICE$;
CLOSE (LFO)
Thanks