Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Now, I want to add a step which can count the length of each record.
Nayanish Patil,
Your OUTERC statement sets the length of every record to 83 bytes.
By the "length of each record" do you mean the position of the last non-blank character in each record (e.g. the position of the last '4' in the first record), or do you mean something else? If you mean something else, please explain exactly what you mean.
The Input record length is 80 and Fixed Block.
The Output record length is 83 and also Fixed Block.
Yeah, I want to add another step which will count until the last non-blank character in each record, and as you said after 4 in case of 1st record.
But, we should take a note that the output generated also has some spaces in between.
The next step which I want to add should count until the last character, and if the record length is say 9 (including any spaces in between), then I intend to perform some function on that output record and write to some other file.
I hope the above details make the probelm statement more clear.
It's not clear if you just want the "length" in the output record, or you want the characters and the length, or what.
I want to get the total length of each output record, ie total number of characters of each output record (including any in between spaces).
Frank Yaeger wrote:
Again, please show the expected output records for your example input records.
From the sample output:
nayanishpatil wrote:
55 545164
64 683646
31 23111124
11 11
say for the first record, the total length comes out to be 12 (going as per the OUTREC condition of JCL), then the step which I want to add should be able to give me 12 as the result of first output record.
Based on this, if the length is 12 then I can write another output file and for the record with lenght 9 or 8 or 5, I can do some other operations.
I hope that this information is more clear than the earlier ones.
The above code in the JCL moves one space at the begining, then moves 2 spaces instead of the first two characters of input record, and the remainging 9 characters of the record are moved as such.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I hope that this information is more clear than the earlier ones
Nayanish,
I understand what you want to do (I have for a while now). What I don't know is what you want the output to look like. That's what I want an example of. For example, do you want the output records to contain: