Extract the data's from Dataset into two datasets



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Extract the data's from Dataset into two datasets

Postby srrc » Tue Mar 28, 2017 2:07 pm

Dear all,

Hope all are doing great.

I am having a dataset which contains the 100 records.
I want to split this dataset into two dataset.

Input dataset:
=COLS> -1----+----2----+----3----+----4----+----5----+----6----+----7----+
000001                       +--------------------------------------------
000002                     1_| XXX                | 22.03.2017         | 0
000003                     2_| YY                 | 21.03.2017         | 0
000004                     3_| ZZZ                | 20.03.2017         | 1


Am passing value to JP0 as 22.03.2017 and sort card as below
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE COND=(54,10,CH,EQ,JP0)
OUTFIL FILES=02,INCLUDE COND=(75,1,CH,EQ,C'1')


Am getting syntax error while executing the above sort.

Output dataset:
I want output dataset as below
=COLS> ----+----1----
000001 XXX 22.03.2017
 

Is it possible to format the output like with include statement?

Thanks in advance.

Sorry for any mistake in the question.
srrc
 
Posts: 13
Joined: Tue Mar 28, 2017 1:43 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Extract the data's from Dataset into two datasets

 

Re: Extract the data's from Dataset into two datasets

Postby NicC » Tue Mar 28, 2017 2:32 pm

Please cut and paste the relevant part of the SYSOUT (including message identifiers).
(From what you posted it looks like your control cards start in col 1 which is a no-no.)
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2687
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Extract the data's from Dataset into two datasets

Postby srrc » Tue Mar 28, 2017 3:02 pm

Dear NicC,

I have changed the sort card (starts from col 4) as below and it worked.

SORT FIELDS=COPY
OUTFIL FNAMES=SORTOF1,INCLUDE=((54,10,CH,EQ,JP0),AND,(75,1,CH,EQ,C'1'))
OUTFIL FNAMES=SORTOF2,INCLUDE=(75,1,CH,EQ,C'1')


It extracted as per the condition given.

but i need the output as mentioned on the 1st post.
am trying with outrec.

Thanks for the reply.
srrc
 
Posts: 13
Joined: Tue Mar 28, 2017 1:43 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Extract the data's from Dataset into two datasets

Postby srrc » Tue Mar 28, 2017 4:48 pm

Dear all,

I got the output as I mentioned in the first post.

Now am trying to use Joinkeys.here are the details:

JNF1:
----+----1----
XXX 22.03.2017
YY  21.03.2017
ZZZ 22.03.2017


JNF2:
----+----1----+----2----+----3----+----4----+----5----+----6-
***************************** Top of Data *******************
XXX                01.01.2016                           9  N
AAA                01.01.2016                           6  N


Keys: 1,3 on both datasets.

Sort card:
JOINKEYS FILES=F1,FIELDS=(1,3,A)
JOINKEYS FILES=F2,FIELDS=(1,3,A)
REFORMAT FIELDS=(F2:57,2,F1:1,14)
SORT FIELDS=COPY
OUTREC BUILD=(1,2,X,3,3,X,6,11,62X)

By using the above sortcard am getting the output as follow,
----+----1----+---
9 XXX  22.03.2017
 

But i need the output as below
----+----1----+---
9 XXX  22.03.2017
   YY  21.03.2017
 


Matched and also unmatched from JNF1 with data from JNF2. is this possible?
Thanks in advance.
srrc
 
Posts: 13
Joined: Tue Mar 28, 2017 1:43 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Extract the data's from Dataset into two datasets

Postby BillyBoyo » Tue Mar 28, 2017 8:48 pm

You have no JOIN statement, so you get the default, which is of matched records only.

So, you need a JOIN with UNPAIRED,F1 which will give you matched records, plus unmatched F1.

There are probably some efficiencies which can be included for what you have coded so far for the entire process, so maybe post it.

These users thanked the author BillyBoyo for the post:
srrc (Wed Mar 29, 2017 8:24 am)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Extract the data's from Dataset into two datasets

Postby srrc » Wed Mar 29, 2017 8:28 am

Dear BillyBoyo,

yes, I got the output as you mentioned to use Join with UNPAIRED,F1.. Thank you.
srrc
 
Posts: 13
Joined: Tue Mar 28, 2017 1:43 pm
Has thanked: 2 times
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post