Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

need do keep only changed data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Fri Jan 02, 2009 7:17 pm    Post subject: need do keep only changed data
Reply with quote

hi all,

I have one file :

1000 ABC DEF
2000 IJK LMN
3000 ABC EFG
1000 ABC DEF
2000 IJK OPQ
3000 ABC EFG

I want output file with duplicate records on 1,4 and changed data:
2000 OPQ
As 2000 has the same value on 5,3 i don't need IKJ.

Regards,
Back to top
View user's profile Send private message

loverj24

New User


Joined: 05 Jul 2007
Posts: 16
Location: bangalore

PostPosted: Fri Jan 02, 2009 7:36 pm    Post subject:
Reply with quote

Hi Farouck,

Welocme to the forum.

Could you please give us a clear example of what you need, do you need to eliminate duplicates here?
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Fri Jan 02, 2009 7:53 pm    Post subject:
Reply with quote

hi loverj24,

Yes i need to eliminate duplicates records for each but for each line too.

In my sample :
the lines 2000 are not duplicates because the 3th records is not the same

2000 IJK LMN
2000 IJK OPQ

But the second records is the same

Then i wants: 2000 OPQ
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 02, 2009 8:41 pm    Post subject:
Reply with quote

Your description is still unclear and confusing.

Quote:
3th records


You mean the "3rd value" - right?

Quote:
But the second records is the same


You mean the "second value" - right?

Please try to use the correct terminology to avoid confusion.

Quote:
As 2000 has the same value on 5,3 i don't need IKJ.


In your example, it looks like IKJ is at 6,3, not 5,3. Is there actually a blank between the fields or not?

What is the RECFM and LRECL of the input file? What is the starting position and length of each of the three fields?

A better example with more variations would help. For example, what do you expect for output with the following input records and why (assume the values for the three fields are in the correct positions)?

Code:

1000 ABC DEF
2000 IJK LMN
3000 ABC EFG
4000 XYZ ABC
5000 ABC DEF
1000 ABC DEF
2000 IJK OPQ
3000 ABC EFG
4000 MNO ABC
5000 CDE TUX
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Fri Jan 02, 2009 8:53 pm    Post subject:
Reply with quote

hi frank,
I' m sorry if i don't be clear.

for this sample i wants :

Code:

2000     LMN
4000 XYZ
5000 ABC DEF


LRECL=23
RECFM=FB
First field on 1 to 4
second field on 6 to 8
third field on 10 to 12
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2159
Location: @my desk

PostPosted: Fri Jan 02, 2009 9:55 pm    Post subject:
Reply with quote

farouck,

Do you have always 2 duplicate key records? Or the number can vary?

For e.g, Is the following input possible? If yes, what would be the output for that. Let me know if I got this wrong.
Code:
1000 ABC DEF
2000 IJK LMN
3000 ABC EFG
2000 IJK OPQ
3000 ABC EFG
2000 IJK STU
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Fri Jan 02, 2009 10:02 pm    Post subject:
Reply with quote

hi Arcvns,

i have always 2 duplicate keys for the first records (not more).
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 02, 2009 10:48 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. You'll need z/OS PTF UK90013 (July, 2008) to use DFSORT's new WHEN=GROUP function. If you don't have that PTF, ask your System Programmer to install it (it's free).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=..  input file (FB/23)
//SORTOUT DD DSN=...  output file (FB/23)
//SYSIN    DD    *
  OPTION EQUALS
  SORT FIELDS=(1,4,CH,A)
  OUTREC IFTHEN=(WHEN=INIT,
     BUILD=(1,4,24:SEQNUM,1,ZD,RESTART=(1,4),32:6,7)),
    IFTHEN=(WHEN=GROUP,BEGIN=(24,1,CH,EQ,C'1'),
      PUSH=(25:32,7))
  OUTFIL INCLUDE=(24,1,CH,EQ,C'2',AND,25,7,CH,NE,32,7,CH),
    IFOUTLEN=23,
    IFTHEN=(WHEN=(25,3,CH,NE,32,3,CH),OVERLAY=(6:25,3),HIT=NEXT),
    IFTHEN=(WHEN=(29,3,CH,NE,36,3,CH),OVERLAY=(10:29,3))
/*


For complete details on the DFSORT's new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Mon Jan 05, 2009 8:03 pm    Post subject:
Reply with quote

Thanks you for the jcl, but this ptf is not applied.
I 'll take here with the next refresh in march.

Did you have the same jcl without Group.

Regards,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jan 05, 2009 11:50 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you want without WHEN=GROUP. Note that this job is less efficient than the WHEN=GROUP job.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=..  input file (FB/23)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/23)
//TOOLIN  DD    *
SORT FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(1,4,CH) WITH(32,7) USING(CTL2)
/*
//CTL1CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(1,4,CH,A)
  OUTREC IFOUTLEN=38,
    IFTHEN=(WHEN=INIT,
     OVERLAY=(24:SEQNUM,1,ZD,RESTART=(1,4))),
    IFTHEN=(WHEN=(24,1,CH,EQ,C'1'),
      BUILD=(1,4,25:6,7)),
    IFTHEN=(WHEN=NONE,
      BUILD=(1,4,32:6,7))
/*
//CTL2CNTL DD *
  OPTION COPY
  OUTFIL FNAMES=OUT,
    INCLUDE=(25,7,CH,NE,32,7,CH),
    IFOUTLEN=23,
    IFTHEN=(WHEN=(25,3,CH,NE,32,3,CH),OVERLAY=(6:25,3),HIT=NEXT),
    IFTHEN=(WHEN=(29,3,CH,NE,36,3,CH),OVERLAY=(10:29,3))
/*
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2159
Location: @my desk

PostPosted: Tue Jan 06, 2009 11:05 am    Post subject:
Reply with quote

May be I am missing something here. In his first post the OP said he needed the fields from the modified records. But in his latest post, the required output has the initial values when a mismatch is found. icon_rolleyes.gif
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Tue Jan 06, 2009 6:40 pm    Post subject:
Reply with quote

For me it is the same, because i merge two files, the first value can be the modified value or the initial value.

Thanks a lot at franck for the solution.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2159
Location: @my desk

PostPosted: Tue Jan 06, 2009 6:56 pm    Post subject:
Reply with quote

Quote:
For me it is the same
I m sorry, still I am not clear.icon_sad.gif Consider the sample input posted by Frank. Are you saying that the below output is also acceptable?
Code:

2000     OPQ
4000 MNO
5000 CDE TUX
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Tue Jan 06, 2009 7:27 pm    Post subject:
Reply with quote

With the sample and the jcl of franck my output is :

Code:

2000     LMN               
4000 XYZ                   
5000 ABC DEF         


But you are right, i changed the desired resultat in comparison with the beginning.

To have this ouput or your ouput is same for me because i can order the file as i wants.

I'm clear?

Lionel
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jan 06, 2009 9:33 pm    Post subject:
Reply with quote

So to be clear, my job gives you the output you want - right?
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Tue Jan 06, 2009 9:45 pm    Post subject:
Reply with quote

yes, your job is ok for me.

Thanks,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us