Need to put records a Sorting order as mentioned below.

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Yash1911
Member
Posts: 5
Joined: Tue Jun 03, 2008 11:22 am

Need to put records a Sorting order as mentioned below.

Post by Yash1911 » Mon Oct 29, 2012 6:39 pm

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.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Oct 29, 2012 7:44 pm

You have to look at PARSE.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Oct 29, 2012 8:27 pm

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?
Regards
Nic

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Mon Oct 29, 2012 9:06 pm

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?
Have a good one

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue Oct 30, 2012 4:00 am

FUNDVALUEDTL;ISS;;06;
This has 3 semicolons so why have you highlighted it?
Regards
Nic

Yash1911
Member
Posts: 5
Joined: Tue Jun 03, 2008 11:22 am

Post by Yash1911 » Tue Oct 30, 2012 11:06 am

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.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Oct 30, 2012 1:05 pm

So, did you look at PARSE?

Yash1911
Member
Posts: 5
Joined: Tue Jun 03, 2008 11:22 am

Post by Yash1911 » Tue Oct 30, 2012 2:02 pm

Yes, but looks PARSE works only with DFSORT, and at our end server not supports DFSORT product.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Oct 30, 2012 3:01 pm

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?

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Oct 31, 2012 6:26 am

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.
Have a good one

Yash1911
Member
Posts: 5
Joined: Tue Jun 03, 2008 11:22 am

Post by Yash1911 » Wed Oct 31, 2012 4:25 pm

SYNCSORT FOR Z/OS 1.3.2.1R U

SYNCSORT LICENSED FOR CPU SERIAL


These are first couple of lines of SYSOUT.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Oct 31, 2012 5:04 pm

So put a very simple PARSE together and show the full Sysout, please.

Yash1911
Member
Posts: 5
Joined: Tue Jun 03, 2008 11:22 am

Post by Yash1911 » Wed Oct 31, 2012 6:06 pm

yes .using Parse got some solution..thanks...

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Oct 31, 2012 8:18 pm

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.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 9:50 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others