Page 1 of 1

Need to put records a Sorting order as mentioned below.

Posted: Mon Oct 29, 2012 6:39 pm
by Yash1911
Can you pls help to get the records in below order using sort.

eg: Records are like :
04;WEL015;99250112599;FUNDVALUEDTL;ISS;;;;;
03;WEL015;99250112599;FUNDVALUEHDRALLFUNDS;ISS;
04;WEL015;99250121955;FUNDVALUEDTL;ISS;1.0000;08;1.0000;RIVER5
04;WEL015;99250121956;FUNDVALUEDTL;ISS;;06;1.0000;RIVER3
04;WEL015;99250121959;FUNDVALUEDTL;ISS;1.00;01;1.0000;RIVER1
04;WEL015;99250121960;FUNDVALUEDTL;ISS;1.00;02;1.0000;RIVER2

==> We are looking sort these records such that for ";FUNDVALUEDTL" the type codes (08,06,01,02) highlighted in bold; records should be in order as type code 01 then 02 then 06 then rest. Issue here is the position of type code is not fixed but for sure it comes after two semi- columns(;) after b]FUNDVALUEDTL[/b].

We thought below sort but not able to collect what exactly should be there after WHEN condition.?????
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(27,13,CH,EQ,C'FUNDVALUEDTL;')
SORT FIELDS=(???????????????????))
OUTREC FIELDS=(1:5,3004)

Thanks in advance.

Posted: Mon Oct 29, 2012 7:44 pm
by William Collins
You have to look at PARSE.

Posted: Mon Oct 29, 2012 8:27 pm
by NicC
You cannot do it with JCL so why post in the JCL forum instead of the SORT forum which handles both DFSort and SYNCSORT?

Which sort product do you use?
What happens when there is no value 2 semicolons along - as per your first example record?

Posted: Mon Oct 29, 2012 9:06 pm
by DikDude
First - both a COPY and a SORT FIELDS may Not be used in the same run.

Regarding Nic's question - if there is no value, then the record should be skipped or should it be kept?

Posted: Tue Oct 30, 2012 4:00 am
by NicC
FUNDVALUEDTL;ISS;;06;
This has 3 semicolons so why have you highlighted it?

Posted: Tue Oct 30, 2012 11:06 am
by Yash1911
Sorry for a confusion.

To your ques:
We can use SYNCSORT, SORT or ICETOOL.

And yes , Nicc Type code comes after three(not 2) semi- columns(;) following FUNDVALUEDTL

If there is no value as per first example record, then the record should be should be kept and not skipped.

Posted: Tue Oct 30, 2012 1:05 pm
by William Collins
So, did you look at PARSE?

Posted: Tue Oct 30, 2012 2:02 pm
by Yash1911
Yes, but looks PARSE works only with DFSORT, and at our end server not supports DFSORT product.

Posted: Tue Oct 30, 2012 3:01 pm
by William Collins
What product are you using? PARSE works with SyncSort. What do you mean by "server"? Are you trying this on a Mainframe or somewhere else?

Posted: Wed Oct 31, 2012 6:26 am
by DikDude
When you run a sort (any sort) the product and release are placed in the informational output.

Please post the first few lines of some sort sysout.

Posted: Wed Oct 31, 2012 4:25 pm
by Yash1911
SYNCSORT FOR Z/OS 1.3.2.1R U

SYNCSORT LICENSED FOR CPU SERIAL


These are first couple of lines of SYSOUT.

Posted: Wed Oct 31, 2012 5:04 pm
by William Collins
So put a very simple PARSE together and show the full Sysout, please.

Posted: Wed Oct 31, 2012 6:06 pm
by Yash1911
yes .using Parse got some solution..thanks...

Posted: Wed Oct 31, 2012 8:18 pm
by dbzTHEdinosauer
congratulations,
apparently William was able to point you in the
right direction
so that you could learn, yourself, how to accomplish the task!

That makes responding to questions enjoyable.
Not only have we shared,
but someone is well on their way to sharing, also.

Topic deleted by Admin

Posted: Mon Jan 25, 2016 9:50 pm
by academyindia4
<< Content deleted By Admin >>