I have requirement and can somebody help me out
I want to join the alternate lines of a file in one line, with odd or even number of records (in latter case last record remains unjoined)
I have file (FB, LRECL = 80) containing records
or if possible (better)
Here "." and "," signifies spaces (different symbols just to differentiate spaces on alternate line.
Thanks in advance
Unfortunately, MP's solution depends on having . and , in the records whereas you've said those are actually blanks. MP's solution is also inefficient in that it uses three passes whereas one pass would do.
I can show you how to do what you want, but I need to understand what it is you actually want first. It's not clear what exactly you want for the output. You show two different versions and mp shows another. If you explain the "rules" you want to use for going from input to output, I can probably show you a better way to do what you want to do. For example, do you want the string before the first blank in the even records (e.g. ABCD) and the string between the first non-blank and the next blank in the odd records (e.g. ---records found1---)? Or do you want something else? What is the maximum length of the string from the odd and even records? Etc.
What is the RECFM and LRECL of the input and output files?
Give me more information about what you want and I'll show you how to do it.
Here's a DFSORT/ICETOOL job that will join each pair of records with the data from the first record in positions 1-80 of the output record and the data from the second record in positions 81-160 of the output record:
You can't really squeeze out some of the blanks but not all of the blanks since there's no way to tell which blanks are which. (You could left justify the data in the second record so the first nonblank characters starts in position 81, but I didn't bother showing that since your example shows the data already starting in position 1 of the second record.)
You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use INREC with SPLICE. If you don't have the April, 2006 PTF, you won't get the correct output, so ask your System Programmer to install the PTF (it's free).
Ok Thanks Frank I am getting the correct results.
Can you clear one doubt of mine my shop has both DFSORT V1R5 and DFSORT R14 on two different LPAR's when I run the job with DFSORT V1R5 I get the correct output i.e.
could it be because PTF's are not applied for DFSORT R14
Yes. You need the April, 2006 PTF to get the correct results. From what you've said, it appears that you have the PTF for z/OS DFSORT V1R5 on your z/OS 1.7 system, but you don't have the PTF for DFSORT R14 on your z/OS 1.4. system.
Note: z/OS DFSORT V1R5 runs on z/OS 1.5 and above. DFSORT R14 runs on z/OS 1.4 and below.
Ask your System Programmer to install DFSORT R14 PTF UK90006.
For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
Ok thanks Frank, I remember having a similar problem before for SQZ and this was the cause of it. Probably as we are migrating on both LPARs to z/OS 1.7 thats why no upgradations are done to the older LPAR.