MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple BUILDS in SORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sheelu
Beginner


Joined: 07 Apr 2014
Posts: 26
Topics: 6

PostPosted: Tue Apr 08, 2014 12:14 pm    Post subject: Multiple BUILDS in SORT Reply with quote

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...
Code:

INCLUDE COND=(2, 7, CH, EQ, C'IEF142I', OR, 21, 7, CH, EQ, C'IEF450I,
OR, 21, 7, CH, EQ, C'IEF404I')
INREC IFTHEN=(WHEN=(21,7,CH,EQ,C'IEF452I') ,
PARSE=(%01=(STARTAFT=C'IEF452I  ',ENDBEFR=C' ',FIXLEN=8),
 %02=(,ENDBEFR=C'-',FIXLEN=8), 
%03=(STARTAFT=C'COND CODE',FIXLEN=8), 
 BUILD=(%01,C'#',%02, C'#',% 03)),
IFTHEN=(WHEN=(21, 7, CH, EQ, C'IEF404I'),
PARSE=(%04=STARTAFT=C'TIME=', FIXLEN=8),
BUILD=(DATE1 (/), C'#',% 04))

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 ?..

Sorry for digging the topic again...
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Tue Apr 08, 2014 1:20 pm    Post subject: Reply with quote

Welcome to the forum,

What happens when you try it?

You only need a few records to test . . .
_________________
All the best,

di
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Tue Apr 08, 2014 3:51 pm    Post subject: Re: multiple BUILDS in SORT Reply with quote

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?

http://www.mvsforums.com/helpboards/viewtopic.php?t=12366

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:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080

sheelu wrote:

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.

sheelu wrote:
Sorry for digging the topic again...


Please DO NOT do that.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sheelu
Beginner


Joined: 07 Apr 2014
Posts: 26
Topics: 6

PostPosted: Tue Apr 08, 2014 8:26 pm    Post subject: Reply with quote

Papadi...

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.
Sad

Kolusu...

I Will look into splice/group utilities..Thanks Very Happy
Back to top
View user's profile Send private message
sheelu
Beginner


Joined: 07 Apr 2014
Posts: 26
Topics: 6

PostPosted: Wed Apr 09, 2014 1:44 am    Post subject: Reply with quote

Hi..

I did read about SPLICE parameter and GROUP parameter.
But I have a query.Suppose I have the following input datasets:

file 1:

contains data in the below format

xxxxxxxx|xxxxxxxxx|xxxx xxxxx xxxxxxxx| (totally 39 characters)

file 2:

containing date and time in the format:

xxxx/xx/xx|xx.xx.xx| (20 characters)

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.

ie xxxxxxxx|xxxxxxxx|xxxx xxxxx xxxxxxxx|xxxx/xx/xx|xx.xx.xx|

I read about GROUP parm but I am not sure about how to achieve the above condition using the same.
Back to top
View user's profile Send private message
sheelu
Beginner


Joined: 07 Apr 2014
Posts: 26
Topics: 6

PostPosted: Tue Jun 03, 2014 4:02 am    Post subject: Reply with quote

Thanks Kolusu and Papadi...I was able to print everything on a single line in the dataset with your inputs. Smile ..I tried the group parm
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group