reading fixed width cobol file in snaplogic using python script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2024 09:57 AM
hi Team,
i am currently using this copybook layout in datastage and reading the content in the file.now i am trying to read this content using snaplogic script snap using python script.but i am not getting the expected output as datastage process.so 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2024 03:08 PM
If this is a valid copybook file, we have a COBOL Copybook parser that would do this with one snap, Ref: https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/2386591995/Copybook+Snap+Pack.
Other snaps of interest would be the transcoder and fixed width parser snaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2024 11:19 AM
Hi rdill,
We don't have the copybook parser snap.so 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2024 02:07 AM
this is my copybook layout and sample file how to convert this into csv using the python script
