I am working on the COBOL module for which I need to convert the Python variables to the equivalent COBOL variables. I am receiving data from an web application and it needs to be given to cobol module.So I am reading that data in python and storing it in variables, now i need to convert each variable to COBOL variable. So I can use those values with copybook which is already present in my system.
I have tried to search on github using pycobol but it is all COBOL to python (lists,csv) What I need is exactly opposite.
For Example if in python i have h=6,b='ab'
it should be converted to
01 H PIC 9(1) value 9
01 B PIC X(2) value 'AB'
Simon Sobisch's comment should be turn into an answer. It's probably easy for python to output something into json text file; then in the COBOL side, you can JSON PARSE that into COBOL.