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
 

 

Can it be done using any of the SORT techniques

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

New User


Joined: 10 Nov 2006
Posts: 49
Location: Canada

PostPosted: Thu Mar 29, 2007 1:25 am    Post subject: Can it be done using any of the SORT techniques
Reply with quote

Hi,
I need to do operation on a character field of 7 bytes.
But it can hav any number of digits.
No number will be repeated except few, whose duplicate will be prefixed with 0.

eg:- 123456 --> 6byte
0123456--> 7byte
wat i want is that if such a situation arises 0123456 should be selected.

Input File:-
147852
123456
0123456
963258
0654456
654456

Output File should have:-
147852
0123456
963258
0654456

can it be done using any of the SORT techniques?
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: Thu Mar 29, 2007 1:57 am    Post subject:
Reply with quote

What is the RECFM and LRECL of the input file?

Are we only worried about duplicates for 6-byte values vs 7-byte values, or are there other variations such as 5-byte values vs 6-byte values. Please give a complete picture of the variations along with examples.

Do the output records have to be in the original order of the input records or can they be sorted by the numeric values?
Back to top
View user's profile Send private message
kaushik8205

New User


Joined: 10 Nov 2006
Posts: 49
Location: Canada

PostPosted: Thu Mar 29, 2007 3:10 pm    Post subject: Re: Can it be done using any of the SORT techniques
Reply with quote

REcord format is FB and LRECL = 300. The duplicates we need to handle i case of 7 and 6 bytes only.

In normal case there won't be any duplicates. But if the same Policy is coming from 2 different systems, then on esystem sends it by prefixing 0.
So when we query from database we all the policies get selected. Now while giving this Unload file as to our program, we don't want any duplicates. And in case there eg:- 0123456 and 123456 we want 0123456.

Hope this clarifies my requirement.
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: Thu Mar 29, 2007 9:47 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. You didn't answer my question about whether the output records could be in sorted order, so I assumed you wanted them in their original order as shown in your example. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use INREC with SELECT. If you don't have the April, 2006 PTF, you won't get the correct output, so ask your System Programmer to install the PTF (it's free). Alternatively, you could use COPY with INREC and SELECT without INREC instead of SELECT with INREC.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (FB/300)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/300)
//TOOLIN   DD    *
SELECT FROM(IN) TO(T1) ON(309,7,CH) FIRST USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,
    OVERLAY=(301:SEQNUM,8,ZD,309:1,7,UFF,M11,LENGTH=7,316:C'A')),
   IFTHEN=(WHEN=(7,1,CH,EQ,C' '),OVERLAY=(316:C'B'))
  SORT FIELDS=(309,7,CH,A,316,1,CH,A)
/*
//CTL2CNTL DD *
  SORT FIELDS=(301,8,ZD,A)
  OUTREC BUILD=(1,300)
/*
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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