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
 

 

2 INPUT FILE == > 1 OUTPUT FILE

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

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Thu Mar 25, 2010 3:26 pm    Post subject: 2 INPUT FILE == > 1 OUTPUT FILE
Reply with quote

hi everyone,
I have two input files and I have to build an output file.
1 contains the input file duplicates.
2 input file has no duplicates.
have in common the key from position 1 to 17.
the output file should contain all the records of the input file input file 1 + 2


FILEINPUT 1 (FB length 100)
05228000081302001 PD310
05228000081302001 PC310
05228000081302001 ZX310
05228000012854555 PD310
05228000012854555 AD310

FILEINPUT 2 (FB length 150)
05228000081302001 PD310 XXXXXXXXXXXXXXXXXXXXXXXXXXX
05228000012854555 PD310 YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY


FILE OUTPUT (FB length 150)
(contain from position 1 to 30 of fileinput 1 + from posizion 31 to 150 of fileinput 2)
05228000081302001 PD310 XXXXXXXXXXXXXXXXXXXXXXXXXXX
05228000081302001 PC310 XXXXXXXXXXXXXXXXXXXXXXXXXXX
05228000081302001 ZX310 XXXXXXXXXXXXXXXXXXXXXXXXXXX
05228000012854555 PD310 YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
05228000012854555 AD310 YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY


i hope it's all clear.
Back to top
View user's profile Send private message

Rambhupal.chaudari

New User


Joined: 30 Mar 2007
Posts: 25
Location: Hyderabad

PostPosted: Thu Mar 25, 2010 5:29 pm    Post subject:
Reply with quote

Hi dude,

Try this.

Code:
//STEP0001 EXEC PGM=ICETOOL                               
//INDD1    DD   *                                         
05228000081302001 PD310                                   
05228000081302001 PC310                                   
05228000081302001 ZX310                                   
05228000012854555 PD310                                   
05228000012854555 AD310                                   
/*                                                         
//INDD2    DD   *                                         
05228000081302001 PD310 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX   
05228000012854555 PD310 YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY   
/*                                                         
//T1       DD  DISP=(MOD,PASS),UNIT=VIO,SPACE=(TRK,(1,1)) 
//OUT      DD  DSN=temp,               
//             DISP=(OLD,CATLG,DELETE),                   
//             SPACE=(CYL,(5,5),RLSE)                     
//DFSMSG   DD  SYSOUT=*                                         
//TOOLMSG  DD  SYSOUT=*                                         
//TOOLIN   DD  *                                               
COPY FROM(INDD2) TO(T1) USING(CTL1)                             
COPY FROM(INDD1) TO(T1) USING(CTL2)                             
SPLICE FROM(T1) WITHALL   USING(CTL3)-                         
   ON(1,17,ZD) -                                               
   WITH(19,05) -                                               
   TO(OUT)                                                     
/*                                                             
//CTL1CNTL DD *                                                 
  OUTREC FIELDS=(1:1,17,25:25,31)                               
/*                                                             
//CTL2CNTL DD *                                                 
  OUTREC FIELDS=(1:1,17,19:19,05)                               
/*                                                             
//CTL3CNTL DD *                                                 
   SORT  FIELDS=(1,17,ZD,D)             
/*
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Thu Mar 25, 2010 7:56 pm    Post subject:
Reply with quote

thank you!
it works!
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Mar 25, 2010 9:29 pm    Post subject:
Reply with quote

theone1987,

Isn't this request quite similar to the similar requests you asked before

http://ibmmainframes.com/viewtopic.php?t=47545

http://ibmmainframes.com/viewtopic.php?t=47457

Try to understand the solutions and modify your new requirements accordingly. Despite me explaining via PM you still have the same matching files questions all over again.

Here is the DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=your input FB 100 file,DISP=SHR
//SORTOUT  DD DSN=&&TM150,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)           
//HEADR    DD DSN=&&HEADR,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)           
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  INREC BUILD=(1,30,150:X)                                             
  OUTFIL FNAMES=HEADR,ENDREC=1,BUILD=(3C'$',150:X)                     
//*                                                                     
//STEP0200 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=&&HEADR,DISP=SHR,VOL=REF=*.STEP0100.HEADR             
//         DD DSN=your input FB 150 file,DISP=SHR
//         DD DSN=&&HEADR,DISP=SHR,VOL=REF=*.STEP0100.HEADR             
//         DD DSN=&&TM150,DISP=SHR                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(151:ID=1))   
  SORT FIELDS=(1,17,CH,D),EQUALS                                       
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(153:SEQNUM,8,ZD,RESTART=(1,17))),   
  IFTHEN=(WHEN=GROUP,BEGIN=(153,8,ZD,EQ,1),PUSH=(31:31,120,152:151,1)) 
  OUTFIL BUILD=(1,150),INCLUDE=(151,2,ZD,EQ,21,AND,1,3,CH,NE,C'$$$')   
//*
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 Incorrect output when trying to add n... monica1 PL/I & Assembler 6 Fri Jan 13, 2017 5:02 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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