IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can it be done using any of the SORT techniques


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Mar 29, 2007 1:57 am
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
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 Developer


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

PostPosted: Thu Mar 29, 2007 9:47 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top