Is there a simple way to do that?
What I've found until now is to extract the first record in one file, after extract the second in another one. Then merge the two files record-by-record with the icetool SPLICE option.
This doesn't seem to be the simplest solution to implement..
In fact my requirement change and becomes more complicated.
There could be more than 2 records. We don't know in advance how many. I would like to append all the records (In any case not more that 10) in a big one. Records are 80 LRECL. Also, only numbers should be retained.
CCC2 77DDD 7 B
FFF 456 F3
Is that feasible in the same manner? Would the SPLICE work? Or should be put some kind of 'witheach' or something? After I imagine a step removing all non numeric characters. Again, is that feasible?
In any case, I have a Rexx programmer here. This would probably be easier to do in REXX, isn't it? Of course, he may not be available these days for this to be done..
Thanks for this.
Well, no, I don't know how to append these records..
It seems obvious for 2 records with the SPLICE command.
But for more than 2 records and when we don't know how many records we have..I don't really know..
I'll try to find out, but if someone knows the solution..it would be great to share :-)
It's not a business requirement as such, but as you ask, I will explain you the context of the problem.
We have some CICS transactions which generate dynamically a JCL.
What is dynamic in the JCL is the SYSIN data. The job is part of an application we cannot change (package updates every year). I need this SYSIN data to build a report the application does not generate. The SYSIN data got processed by the application and is lost afterwards.
So I thought of adding a new job in TWS planning that would take as input the JCL :-)
My DFSORT would drop the non-SYSIN data, and afterwards do the processing I explained before.
In the SYSIN data, we do not know in advance how many lines there will be. Important is to extract the numeric values as they represents "departments". Other data are either blanks, or alphabetic description of the departments..
The problem with this was that if we have less than 5 records the result is not correct. Let me explain.
Suppose we have input:
With the above code, the result will be:
That is, the 11111111111111111111 is repeated at the end : [max number of lines - number of input file lines] times.
And because I don't know how many lines I really have, I cannot know how to delete those repetitions.
What I did to manage it is:
Knowing that I have max 5 records, I can append in the IN DD 5 blank lines. Know, instead of incorrect repetition, I have blanks..which I can easily remove afterwards!
Even though you ignored my previous post, I'll continue to try to help you.
You can use a DFSORT job like the following to do what you want in one pass. It does NOT have the problem you mentioned. I tested this and it works. If it doesn't work for you, then either you don't have the April, 2006 DFSORT PTF applied, or you changed something incorrectly.
Sorry for your previous reply. I thought it was clear it produced a blank line..
In any case, I found that we haven't the same version installed on our different LPARs. Trying you latest solution on the LPAR I have to build the program, produced an error on SQZ (which shows it does not understand the statement):
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 09:42 ON THU SEP
ICE006A 0 OPERAND DEFINER ERROR
I tried it on another LPAR and it works great!!
Good news, they told me z/os on the first LPAR would be upgraded tomorrow :-)