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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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