Hi,
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
ex
ABCD..................,,,,,,,,,,,,,,---records found1---,,,,,,,,,,,,,,,,,,
byz.....................,,,,,,,,,,,,,,---records found2---,,,,,,,,,,,,,,,,,,
or if possible (better)
ABCD---records found1---
byz---records found2---
Here "." and "," signifies spaces (different symbols just to differentiate spaces on alternate line.
Thanks in advance
Nimesh
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
Nimesh,
The following step divides your input file records into two files. Odd file contains odd records whereas even dsn contain even records. Please remeber the split is after remove blank records.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Nimesh,
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.
both the input and output file have the same format.
Ok Frank, what I need is blank lines should be ignored before proceeding to join alternate lines. i.e.
or only the leading and trailing blanks removed (pls note middle ones are not removed)
abcd....efghwed,,,,,,,efg,,,,,,,jkl
rty.fgdfgqweffogkfg.klfjgdjg
Please let me know is this information sufficient
Thanks
Nimesh
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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, what is the difference between these two DFSORT's. The LPAR that has DFSORT V1R5 is on z/OS 1.7 and other has z/OS 1.4.
Thanks
Nimesh
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
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.