MAINFRAME - TIP OF THE DAY :
When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file
Programmers Voted for below topics. Please Vote for good Posts.
Thank You! for your feedback. Connecting to the server. Please Wait...
The first part of your data is in a fixed position, the thing is to get the final part also in a fixed position. You can use JFY with SHIFT=RIGHT to do that. Once you've got all the data you want in fixed positions, it is simple with BUILD.
No. It doesn't always end with 01. And key1 and key2 that i have mentioned is actually time stamp. so there are "-" elsewhere too.Only thing that is common in all the records is that the output i need contains "00000-0000" i.e, first five bytes and last four bytes are always numbers. So is there anything that could trace this pattern and get me output along with key1(timestamp).
With a variable number of variable-length data items (you could have A E I O U Incorporated, you could have dashes, numbers) and with variable-length data following what you want to extract, it is not going to be convenient.
SORT has no loop-constructs. Although your field is second-from-the-end, that, as a PARSEd field, could be number 10, or number 81.
What is the maximum length of that final field, and how many fields may precede the data you want to extract such that the minimum data-lengths would add up to that length? Then you JFY right, chop off enough to guarantee having your data, and "manually" (coded-out) PARSE to find which field is second-from-last (field after last would be blank).
It's the penalty of not having delimiters, or fixed-length fields or a fixed number of items. Basically a design fault. Although "languages" can find the second-to-last in this case, in others you'd have trouble if the final field contained "words".
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
Cobol Tutorial This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial This Tutorial covers all important aspects of DFSORT. Has more SORT examples