Hi,
I have a VB file of record length 100. I want to add 4 bytes of '0000' at the end of each record. For Example:
Input Record
Record 1: 80 bytes
Record 2: 50 bytes
Output record should be of 104 record length and of VB
The record 1: 80bytes+4 bytes '0000'
Record 2: 50 bytes+4 bytes '0000'
Can it be doable in SORT?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Well, if you can wait, first until September, then until your site moves up to z/OS 2.1, then it will be easy :-)
Quote:
In z/OS V2.1 DFSORT, several usability enhancements are planned. DFSORT will be designed to support new alphanumeric tests for both compare fields and parse fields, including combinations of alphanumeric character sets (uppercase and lowercase, and numeric). This support is intended to allow you to specify various sets of characters using a single compare condition or PARSE keyword rather than using compare conditions or PARSE keywords. Also, enhancements are planned for symbol processing, allowing symbols to be used for more DFSORT operands, and the number of parse fields supported is planned to be increased from the prior limit of 100 fields to 1,000 fields. Finally, new support is planned to allow you to specify that a string up to 50 characters in length be appended to variable-length output records.
Until that time, can you describe your records a bit more?
Do they have a "fixed" part and then a "variable" part? Or are they entirely variable? Do they contain just "character" data, or do you have any non-character fields (binary, packed-decimal)?
Do they have a "fixed" part and then a "variable" part? Or are they entirely variable? Do they contain just "character" data, or do you have any non-character fields (binary, packed-decimal)?
Yes, there will be fixed part. The first 10 bytes is fixed and rest 90 bytes variable block.
They do contains only character fileds.
Change all the (significant, in that we want them on the output) spaces in a record to X'FF.
Overlay immediately after the last byte of the existing maximum, one blank. If there are records shorter than the maximum, the intervening bytes will be padded with EBCDIC space.
Now, change, once only, a space to C'0000'. The first four bytes after the existing data are now "0000", but there are trailing blanks (potentially) as well.
Change the X'FF's back to significant spaces.
Use OUTFIL with VLTRIM=C' ' to drop off the unnecessary trailing blanks which were generated by padding and/or the OVERLAY.
When you have DFSORT 2.1, change the Control Cards to the nice new ones :-)