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

Need Duplicate entries


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Tue Dec 02, 2008 4:52 pm
Reply with quote

Hi All,

I am stuck with the production issue.

I have the two i/p files. The i/p file one contains data like this
Code:
 
INPUT 1(has two variables)
**********************
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3138299197
D 00000000095618996
D 00000006020170210
C 3623170671
D 00000001500011018
C 6528627877
D 00000000003365018
C 3163818150
D 00000003130789502
D 9892511511



Code:

Input 2
**********
3623170671
3163818150



The logic should write two out put file
like the matching records with type 'c' should write the succesive 'D' records in o/p

Code:

OUTPUT 1(MATCHED RECORDS)
**************
C 3623170671
D 00000001500011018
C 3163818150
D 00000003130789502
D 9892511511



Code:

OUTPUT 2(Unmatched records)
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3138299197
D 00000000095618996
D 00000006020170210
C 6528627877
D 00000000003365018



This is just the sample i/p files i have 150000000(i/p 1) records
to match 235000(i/p2) reords.
i didnot know how to explain this in words so given the example i/p and o/p.

Any help would greatly be appreciated
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: Tue Dec 02, 2008 11:32 pm
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. The job uses DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you don't have that PTF, ask your System Programmer to install it (it's free).

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=...  output file1 (FB/80)
//OUT2 DD DSN=...  output file2 (FB/80)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(T2) ON(83,10,CH) KEEPNODUPS KEEPBASE -
  WITHALL WITH(1,81) WITH(93,8)
SORT FROM(T2) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'BB',83:1,10,93:8X)
/*
//CTL2CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'VV')),
    IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'C'),
      PUSH=(83:3,10,93:ID=8))
/*
//CTL3CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(93,8,ZD,A)
  OUTFIL FNAMES=OUT1,INCLUDE=(81,2,CH,EQ,C'VB'),
    BUILD=(1,80)
  OUTFIL FNAMES=OUT2,INCLUDE=(81,2,CH,EQ,C'VV'),
    BUILD=(1,80)
/*
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Wed Dec 03, 2008 12:04 pm
Reply with quote

Thanks for the reply.

Can you please let me know about the 2lines mentioned below if you have availablity

Code:

SPLICE FROM(T1) TO(T2) ON(83,10,CH) KEEPNODUPS KEEPBASE -
  WITHALL WITH(1,81) WITH(93,8)
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Dec 03, 2008 3:22 pm
Reply with quote

Narasimha,

Quote:
Can you please let me know about the 2lines mentioned below if you have availablity


Why don't you give it a try. Check the manuals and try understanding it.

Quote:
SPLICE FROM(T1) TO(T2) ON(83,10,CH) KEEPNODUPS KEEPBASE -
WITHALL WITH(1,81) WITH(93,8)


SPLICE - Operator

FROM(T1) - Tells DFSORT that input to the splice operation is T1 dataset which contains the reformated records from file1.

KEEPNODUPS - Tells DFSORT to keep records that are not spliced.

TO - for the destination dataset

ON(83,10,CH) - 10 bytes starting from position 83 is used for matching. The first record for each matching ON field will act as the base record to which the second record is spliced.

WITH - Fields specified here would be spliced.

WITHALL - tells SPLICE to splice the first record with every other record for which the ON fields match. Without withall, only the first and last are spliced.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Dec 03, 2008 3:24 pm
Reply with quote

Narasimha,

I have just given a generic explanation of what the command does and not specific to your requirement. You will have to probe further to get the exact logic or wait for FRANK.
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Wed Dec 03, 2008 4:34 pm
Reply with quote

The logical record length of IN1 is 43 and
the account number length in IN1 is 17 at position 27,
the 'C' type filed is at positio 23

The logical record lenght of IN2 is 17 (only account numbers)
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Wed Dec 03, 2008 5:26 pm
Reply with quote

Hi I am getting the following error code in DFSMSG

Code:

ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0001
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 05:44 ON WED DEC
            INREC OVERLAY=(44:C'BB',46:1,17,63:8X)
ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW
          DEBUG NOABEND,ESTAE
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=IN2,S
                         RTOUT=T1,DYNALLOC
          SORT FIELDS=COPY
ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K90013 E9-K90013 C9-BASE   E5-K35433
ICE193I 0 ICEAM2 ENVIRONMENT IN EFFECT - ICETD2 INSTALLATION MODULE SELECTED
ICE088I 0 R1493TPT.JS0010  .        , INPUT LRECL = 17, BLKSIZE = 27982, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,16777216,16777216)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (16769008,16719856)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=16777216,MAXLIM=1048576,MINLIM=262144,EQUALS=N,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=12288,RESINV=0,SVC=109 ,CHECK=N,WRKREL=N,OUTREL=N,CKPT
ICE131I 0 OPTIONS: TMAXLIM=16777216,ARESALL=12288,ARESINV=36864,OVERRGN=0,CINV=Y
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=Y,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR T1
ICE084I 0 EXCP ACCESS METHOD USED FOR IN2
ICE751I 1 EF-K10929 F0-K30362 E8-K90013
ICE090I 0 OUTPUT LRECL = 70, BLKSIZE = 27930, TYPE = FB   (SDB)
ICE171I 0 SORTOUT LRECL OF 70 IS DIFFERENT FROM SORTIN(NN) LRECL OF 17 - RC=0
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 239943, OUT: 239943
ICE052I 0 END OF DFSORT
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0002
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 05:44 ON WED DEC
            INREC IFTHEN=(WHEN=INIT,OVERLAY=(44:C'VV')),
              IFTHEN=(WHEN=GROUP,BEGIN=(23,1,CH,EQ,C'C'),
                PUSH=(46:27,17,63:ID=8))
ICE146I 0 END OF STATEMENTS FROM CTL2CNTL - PARAMETER LIST STATEMENTS FOLLOW
          DEBUG NOABEND,ESTAE
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL2,SORTIN=IN1,S
                         RTOUT=T1,DYNALLOC
          SORT FIELDS=COPY
ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K90013 E9-K90013 C9-BASE   E5-K35433
ICE193I 0 ICEAM2 ENVIRONMENT IN EFFECT - ICETD2 INSTALLATION MODULE SELECTED
ICE088I 0 R1493TPT.JS0010  .        , INPUT LRECL = 43, BLKSIZE = 27993, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,16777216,16777216)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (16769008,16719856)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=16777216,MAXLIM=1048576,MINLIM=262144,EQUALS=N,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=12288,RESINV=0,SVC=109 ,CHECK=N,WRKREL=N,OUTREL=N,CKPT
ICE131I 0 OPTIONS: TMAXLIM=16777216,ARESALL=12288,ARESINV=36864,OVERRGN=0,CINV=Y
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=Y,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR T1
ICE084I 0 EXCP ACCESS METHOD USED FOR IN1
ICE751I 1 EF-K10929 F0-K30362 E8-K90013
ICE090I 0 OUTPUT LRECL = 70, BLKSIZE = 27930, TYPE = FB
ICE171I 0 SORTOUT LRECL OF 70 IS DIFFERENT FROM SORTIN(NN) LRECL OF 43 - RC=0
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 18862182, OUT: 18862182
ICE052I 0 END OF DFSORT
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0003
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 05:45 ON WED DEC
          DEBUG NOABEND,ESTAE
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTIN=T1,SORTOUT=T2,DYN
                         LLOC,SZERO,EQUALS,NOVLSHRT,LOCALE=NONE,NOCHECK
          SORT FIELDS=(46,17,CH,A)
          MODS E35=(ICE35DU,12288)
ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K90013 E4-K90007 C9-BASE   E5-K35433
ICE193I 0 ICEAM2 ENVIRONMENT IN EFFECT - ICETD2 INSTALLATION MODULE SELECTED
ICE088I 1 R1493TPT.JS0010  .        , INPUT LRECL = 70, BLKSIZE = 27930, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,16777216,16777216)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (15794176,15728640)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=16777216,MAXLIM=1048576,MINLIM=262144,EQUALS=Y,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=12288,RESINV=0,SVC=109 ,CHECK=N,WRKREL=N,OUTREL=N,CKPT
ICE131I 0 OPTIONS: TMAXLIM=16777216,ARESALL=12288,ARESINV=36864,OVERRGN=0,CINV=Y
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=Y,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR T2
ICE084I 0 EXCP ACCESS METHOD USED FOR T1
ICE750I 0 DC 1337176680 TC 0 CS DSVVV KSZ 21 VSZ 21
ICE752I 0 FSZ=19102524 RC  IGN=0 E  AVG=76 0  WSP=1885628 C  DYN=2905 53216
ICE751I 1 DE-K24705 D5-K24705 D3-K24705 D7-K24705 E8-K90013
ICE090I 0 OUTPUT LRECL = 70, BLKSIZE = 27930, TYPE = FB   (SDB)
ICE055I 0 INSERT 2168497, DELETE 2168497
ICE054I 0 RECORDS - IN: 19102125, OUT: 19102125
ICE134I 0 NUMBER OF BYTES SORTED: 1337148750
ICE165I 0 TOTAL WORK DATA SET TRACKS ALLOCATED: 2940 , TRACKS USED: 0
ICE199I 0 MEMORY OBJECT STORAGE USED = 0M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 1426040K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT
ICE200I 0 IDENTIFIER FROM CALLING PROGRAM IS 0004
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 05:47 ON WED DEC
            OPTION EQUALS
            OUTFIL FNAMES=OUT1,INCLUDE=(44,2,CH,EQ,C'VB'),
              BUILD=(1,43)
            OUTFIL FNAMES=OUT2,INCLUDE=(44,2,CH,EQ,C'VV'),
              BUILD=(1,43)
ICE146I 0 END OF STATEMENTS FROM CTL3CNTL - PARAMETER LIST STATEMENTS FOLLOW
          DEBUG NOABEND,ESTAE
          OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL3,SORTIN=T2,DY
                         ALLOC
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
ICE751I 0 C5-K90013 C6-K90013 E7-K24705
ICE052I 3 END OF DFSORT
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: Wed Dec 03, 2008 11:01 pm
Reply with quote

You are missing the following statement in CTL3CNTL:

Code:

  SORT FIELDS=(63,8,ZD,A)


Here's the complete DFSORT/ICETOOL job:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(T2) ON(46,17,CH) KEEPNODUPS KEEPBASE -
  WITHALL WITH(1,44) WITH(63,8)
SORT FROM(T2) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(44:C'BB',46:1,17,63:8X)
/*
//CTL2CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(44:C'VV')),
    IFTHEN=(WHEN=GROUP,BEGIN=(23,1,CH,EQ,C'C'),
      PUSH=(46:27,17,63:ID=8))
/*
//CTL3CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(63,8,ZD,A)
  OUTFIL FNAMES=OUT1,INCLUDE=(44,2,CH,EQ,C'VB'),
    BUILD=(1,43)
  OUTFIL FNAMES=OUT2,INCLUDE=(44,2,CH,EQ,C'VV'),
    BUILD=(1,43)
/*
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: Wed Dec 03, 2008 11:05 pm
Reply with quote

For complete details on DFSORT's SPLICE operator and all of its operands with examples, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA30/6.13?DT=20080528171007
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Thu Dec 04, 2008 9:18 am
Reply with quote

Hi Frank,

I am geting the 2 output files but they are giving the o/p
for all items that are matcing the account number with 'D' Type also

I am giving the exmaple of i/p and output here

Input (IN1)
Code:

C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3138299197
D 9892511514
D 9892511521
D 00000000095618996
D 00000006020170210
C 3623170671
D 00000001500011018
C 6528627877
D 00000000003365018
C 3163818150
D 00000003130789502
D 9892511511


Input (IN2)
Code:

3623170671
3163818150
9892511511
9892511514


Output(OUT1 Matched)
D 9892511514
C 3623170671
C 3163818150
D 9892511511

Output(OUT2 Unmatched)
Code:

C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3138299197
D 9892511521
D 00000000095618996
D 00000006020170210
D 00000001500011018
C 6528627877
D 00000000003365018
D 00000003130789502
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Dec 04, 2008 10:03 am
Reply with quote

Hello,

This output looks like the required sample data posted icon_confused.gif Both have Cs and Ds - so what is the problem with the actual run versus the sample?

Possibly there are rules not yet posted or maybe i am misunderstanding something.
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Thu Dec 04, 2008 10:31 am
Reply with quote

Hi Frank,

Actually I have misplaced the WITH statement

Quote:

SPLICE FROM(T1) TO(T2) ON(46,17,CH) KEEPNODUPS KEEPBASE -
WITHALL WITH(1,46) WITH(63,8)



This was giving error. But i changed it to
Quote:

SPLICE FROM(T1) TO(T2) ON(46,17,CH) KEEPNODUPS KEEPBASE -
WITHALL WITH(1,44) WITH(63,8)


Now it works fine.

I got the required output .

Thanks for all your support. This wouldn't have possible without your help.
Thanks Once again.


Thanks,
Narasimha
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Fri Dec 05, 2008 11:48 am
Reply with quote

Hi Frank,

The previous task is completed and i have been given a new task repeting the similar way.

Here is the explanation.

With the ouput i got for previous task (OUT2 i.e., the non matched items) I have to seperate the account numbers greater than 10 digit to seperate file (should not miss the pericular debits for that account )

Here is the example i/p
INPUT
Code:

C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 003138299197
D 9892511514
D 9892511521
D 00000000095618996
D 00000006020170210
C 3623170671
D 00000001500011018
C 006528627877
D 00000000003365018
C 3163818150
D 00000003130789502
D 9892511511


OUTPUT file1(WTIH ACCOUNT NUMBER <= 10DIGITS)

Code:

C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3623170671
D 00000001500011018
C 3163818150
D 00000003130789502
D 9892511511


OUTPUT file2(WTIH ACCOUNT NUMBER > 10DIGITS)
Code:

C 003138299197
D 9892511514
D 9892511521
D 00000000095618996
D 00000006020170210
C 006528627877
D 00000000003365018
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: Fri Dec 05, 2008 10:33 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG  DD  SYSOUT=*
//DFSMSG  DD  SYSOUT=*
//IN DD DSN=...  input file (FB/43)
//OUT1 DD DSN=...  output file1 (FB/43)
//OUT2 DD DSN=...  output file2 (FB/43)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(23,1,CH,EQ,C'C'),
    PUSH=(44:27,11))
  OUTFIL FNAMES=OUT1,INCLUDE=(54,1,CH,EQ,C' '),
    BUILD=(1,43)
  OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,43)
/*
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Sat Dec 06, 2008 2:20 pm
Reply with quote

Hi Frank,

sorry i have misplced the task. Actually i need to seperate the account numbers of lenght = 11 ( 'C' type followed by debits'D' type) into one file and other account numbers may be of lenght 10 or >11 to one file.

The above code is working fine for previously mentiond one but little confused with specific account numbers with lenght = 11

Please suggest the idea.

Thanks,
Narasiha
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Sat Dec 06, 2008 3:57 pm
Reply with quote

Hi Frank,

I have used three steps to write account number with lenght 11 into seperate file.

step:1 - used the code and seperated the file into 2 with account number lenght =10 in one file and account number length > 10 to 2 nd file

step:2 - used the 2nd output file of the above and seperated the account number lenght =11 to one file and account number lenght > 11 to other file

Step:3 - merged the file of account number lenght (10 and >11) to one file .

In the step2 i got the output file required .

Is there any other method we can do it more easy.
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: Sun Dec 07, 2008 6:08 am
Reply with quote

You don't need three steps to do that. You can do it in one pass with a slight modification to the job I posted previously like this:

Code:

//S2   EXEC  PGM=ICETOOL
//TOOLMSG  DD  SYSOUT=*
//DFSMSG  DD  SYSOUT=*
//IN DD DSN=...  input file (FB/43)
//OUT1 DD DSN=...  output file1 (FB/43)
//OUT2 DD DSN=...  output file2 (FB/43)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(23,1,CH,EQ,C'C'),
    PUSH=(44:27,12))
  OUTFIL FNAMES=OUT1,
    INCLUDE=(54,1,CH,NE,C' ',AND,55,1,CH,EQ,C' '),
    BUILD=(1,43)
  OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,43)
/*


If IN had these records:

Code:

                      C   8249032544             
                      D   1101646578             
                      D   00000000030256200     
                      D   00000000300953874     
                      C   003138299197           
                      D   9892511514             
                      D   9892511521             
                      D   00000000095618996     
                      D   00000006020170210     
                      C   3623170671             
                      D   00000001500011018     
                      C   006528627877           
                      D   00000000003365018     
                      C   3163818150             
                      D   00000003130789502     
                      D   9892511511             
                      C   11111111111           
                      D   00000000000000001     
                      C   22222222222           
                      D   00000000000000002     
                      D   0000000003             


OUT1 would have:

Code:

                      C   11111111111           
                      D   00000000000000001     
                      C   22222222222           
                      D   00000000000000002     
                      D   0000000003           


OUT2 would have:

Code:

                      C   8249032544                 
                      D   1101646578                 
                      D   00000000030256200           
                      D   00000000300953874           
                      C   003138299197               
                      D   9892511514                 
                      D   9892511521                 
                      D   00000000095618996           
                      D   00000006020170210           
                      C   3623170671                 
                      D   00000001500011018           
                      C   006528627877               
                      D   00000000003365018           
                      C   3163818150                 
                      D   00000003130789502           
                      D   9892511511                 
Back to top
View user's profile Send private message
Naraismha Reddy

New User


Joined: 23 Apr 2008
Posts: 39
Location: Hyderabad

PostPosted: Sun Dec 07, 2008 8:43 pm
Reply with quote

Hi Frank,

Thanks for the reply.
This code is working fine. Thanks once again.

Thanks,
Narasimha
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 Duplicate transid's declared using CEDA CICS 3
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Duplicate data in PUT CONTAINER using... CICS 4
No new posts Remove set of duplicate records from ... DFSORT/ICETOOL 10
Search our Forums:

Back to Top