Showing results for 
Search instead for 
Did you mean: 

reading fixed width cobol file in snaplogic using python script

New Contributor

hi Team,

i am currently using this copybook layout in datastage and reading the content in the i am trying to read this content using snaplogic script snap using python script.but i am not getting the expected output as datastage could you please help me to get this done.

i am attaching the existing cobol file copybook layout which i am using in datastage and the python script which i am using for snaplogic process.

attachments added

1.python code_1

2.python code_2

3.cobol layout file

4.output for the datastage and python script in output.txt file

5.sample data input data



If this is a valid copybook file, we have a COBOL Copybook parser that would do this with one snap, Ref:

Other snaps of interest would be the transcoder and fixed width parser snaps


Hi rdill,

We don't have the copybook parser that's why I am trying to read this cobol file using this python script and passing the output as Json.


Sp could you please help me how to execute this python script in script snap 

this is my copybook layout and sample file how to convert this into csv using the python script