JCL - Get count of non space chars in a given area (mainframe)

前端 未结 2 1462
南方客
南方客 2020-12-06 23:53

I need to prepare some input data to run through a program, the data should be in the following format.

 UID (1-11)|TxtLen (12-16)| Text (17-62)
2条回答
  •  时光取名叫无心
    2020-12-07 00:30

    I've done ad-hoc conversions like this using a REXX program. The program is pretty straight-forward:

    • allocate the input and output files
    • open both files begin loop:
    • read the input
    • extract the text field and strip trailing spaces
    • get length of trimmed text field and format as 5-digit numeric
    • overlay number back into record in the Len field positions
    • write out updated record repeat loop until end of file
    • close both files
    • free allocated files

    Let me know if you need some actual code. I've found that REXX is superior than COBOL when it comes to string functions and manipulations. I've even created and called REXX routines from COBOL to accomplish just that.

提交回复
热议问题