Posted: Tue Apr 08, 2014 12:14 pm Post subject: Multiple BUILDS in SORT
Hi !!!!!
Suppose I have an input file and I want certain data from multiple lines to be formatted in a single line.Can u pls tell me if this is possible using multiple BUILDS???..To make my query more clear, I am taking the scenario provided in the topic-selective copy from spool to dataset...
1.If I execute the above code, I think the second build will overwrite the first build.Please correct me if I am wrong.
2.Is it possible to display the parsed fields in first and second build in the same line?..ie what changes should be made in the above code so that the contents from second build are appended at the end of first build contents instead of overriding ?..
Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
Posted: Tue Apr 08, 2014 3:51 pm Post subject: Re: multiple BUILDS in SORT
sheelu wrote:
Hi !!!!!
Suppose I have an input file and I want certain data from multiple lines to be formatted in a single line.Can u pls tell me if this is possible using multiple BUILDS???..
Yes it is possible and you would need Splice/Group parms to merge them into a single record.
sheelu wrote:
To make my query more clear, I am taking the scenario provided in the topic-selective copy from spool to dataset...
Are you the same person who opened the earlier request?
If so please don't open another topic for the same request as it is a mundane task.
2. Please don't invent your own syntax. Your control cards would fail on any sort product.
sheelu wrote:
1.If I execute the above code, I think the second build will overwrite the first build.Please correct me if I am wrong.
Yes you are wrong. The First build will NOT have IEF404I message in it and your second IFTHEN statement is specifically looking for IEF404I. You can run 1 IFTHEN statement at a time and see how the values are manipulated. Try with a few examples and you will understand.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
2.Is it possible to display the parsed fields in first and second build in the same line?..ie what changes should be made in the above code so that the contents from second build are appended at the end of first build contents instead of overriding ?..
Yes you as I mentioned earlier you need to have SPLICE or GROUP to get the results you want.
Your BUILD statements should arrange the values as follows
Code:
VALUE-1|VALUE-2| |JOB1
VALUE-3|VALUE-4|JOB1
And then when you use SPLICE or GROUP you end up with
Code:
VALUE-1|VALUE-2|VALUE-3|VALUE-4|JOB1
Search the forum for SPLICE or GROUP in utilities/JCL forum and you will find lots of examples.
On executing the above code, only the data and time (IEF404I)(Second build statement) is printed in the output dataset.The IEF142I condition (first build) is not executed though both IEF404I and IEF142I messages are in the input dataset.
Can you please tell me how to form another dataset with the contents of file2 appended at the end of file1??I mean the contents of file 2 should be added to file1 contents from position 40.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum