repository. class HTTPHandler as "com.iscobol.rts.HTTPHandler" class HTTPRequest as "javax.servlet.ServletRequest" . working-storage section. 77 servlet-request object reference HTTPRequest. 77 client-ip pic x any length. linkage section. 77 http-handler object reference HTTPHandler. procedure division using http-handler. set servlet-request to http-handler:>getRequest() as HTTPRequest. set client-ip to servlet-request:>getRemoteAddr(). |
working-storage section. copy "iscobol.def". 77 real-path pic x any length. procedure division. call "wd2$session" using wd2-get-session-value "iscobol.wd2.servletcontext.realpath" real-path. |
{ "name":"John", "age":30, "cars":[ "Ford", "BMW", "Fiat" ] } |
01 json2wrk identified by ''. 03 name identified by 'name'. 05 name-data pic x any length. 03 age identified by 'age'. 05 age-data pic x any length. 03 cars identified by 'cars' occurs dynamic capacity cars-count. 05 cars-data pic x any length. |
$ stream2wrk json yourfile.json –r allcars |
01 allcars identified by ''. 03 name identified by 'name'. 05 name-data pic x any length. 03 age identified by 'age'. 05 age-data pic x any length. 03 cars identified by 'cars' occurs dynamic capacity cars-count. 05 cars-data pic x any length. |