BookmarkSubscribeRSS Feed
Magued
New User | Level 1

Hi,

In a website I am reading data from a certain location in SAS using code similar to:

 const response = await fetch('/JAVASCRIPT/MaxSal/JobCodes.json');
const data = await response.json(); 

 

The values from the dataset are displayed in a website as an html table. 

After the user modifies the table I am creating a JSON string. I am trying to post the values back to the same location however this is not working.  

 

const response = fetch('/JAVASCRIPT/MaxSal/JobCodesNew.JSON', {;
method: 'POST',
headers: {;
Content-Type':'application/json','
Accept': 'application/json'
body: JSON.stringify 

}

Please don't spend time reading the code I am quite sure the syntax is correct. The question is can I post back to the same location that I read the original file from? I have tried using different methods and it didn't work and there is no error.

 

Thanks Magued  

 

1 REPLY 1
ballardw
Super User

This is one of the cases where it may be a good idea to include all of the code involved.

For example, do you close the connection completely after after reading the data? If not then there might be a locking issue.

 

Do you or your organization control the website? It is quite likely that displayed html is generated from another source for display as html and that source may well be what needs to be changed. If your organization controls the site then you may be able to work with the site developers/maintenance staff to determine what access and files are needed. 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 43 views
  • 0 likes
  • 2 in conversation