Progress in data structures
Four decades ago COBOL ruled business IT. Its
Now can someone explain how to do a redefines or a move corresponding in JSON?
DATA DIVISION.
contained all the data structures we ever would need. COBOL had clever constructs like REDEFINES
and (in the procedure division) MOVE CORRESPONDING
. Of course during the last fourty years we made progress. COBOL data was un-throned by XML (OK I skipped some steps in between) which is getting un-throned by JSON. Comparing the formats you clearly can see the progress made:
COBOL
DATA DIVISION .
01 Customer .
02 Name .
03 Lastname PIC A ( 40 ) .
03 Firstname PIC A ( 20 ) .
02 Address .
03 Street PIC X ( 25 ) .
03 Street2 PIC X ( 25 ) .
03 City PIC X ( 25 ) .
03 Zipcode .
04 Zipbase PIC 9 ( 5 ) .
04 Zipextension PIC 9 ( 4 ) .
02 DOB .
03 Month PIC 99 .
03 Day PIC 99 .
03 Year PIC 9999 .
01 Customer .
02 Name .
03 Lastname PIC A ( 40 ) .
03 Firstname PIC A ( 20 ) .
02 Address .
03 Street PIC X ( 25 ) .
03 Street2 PIC X ( 25 ) .
03 City PIC X ( 25 ) .
03 Zipcode .
04 Zipbase PIC 9 ( 5 ) .
04 Zipextension PIC 9 ( 4 ) .
02 DOB .
03 Month PIC 99 .
03 Day PIC 99 .
03 Year PIC 9999 .
XML
<Customer>
<Name>
<Lastname />
<Firstname />
</Name>
<Address>
<Street />
<Street2 />
<City />
<Zipcode>
<Zipbase />
<Zipextension />
</Zipcode>
</Address>
<DOB>
<Month />
<Day />
<Year />
</DOB>
</Customer>
<Name>
<Lastname />
<Firstname />
</Name>
<Address>
<Street />
<Street2 />
<City />
<Zipcode>
<Zipbase />
<Zipextension />
</Zipcode>
</Address>
<DOB>
<Month />
<Day />
<Year />
</DOB>
</Customer>
JSON
function Customer ( ) {
"Name" : {
"Lastname" ,
"Firstname"
} ,
"Address" : {
"Street" ,
"Street2" ,
"City" ,
"Zipcode" {
"Zipbase" ,
"Zipextension"
}
} ,
"DOB" : {
"Month" ,
"Day" ,
"Year"
}
}
"Name" : {
"Lastname" ,
"Firstname"
} ,
"Address" : {
"Street" ,
"Street2" ,
"City" ,
"Zipcode" {
"Zipbase" ,
"Zipextension"
}
} ,
"DOB" : {
"Month" ,
"Day" ,
"Year"
}
}
Now can someone explain how to do a redefines or a move corresponding in JSON?
Posted by Stephan H Wissel on 17 October 2010 | Comments (3) | categories: After hours Software