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

File Concatenation - SORT


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

New User


Joined: 15 May 2008
Posts: 4
Location: Chennai

PostPosted: Tue Nov 03, 2009 8:57 pm
Reply with quote

My Requirement:

Input files:
File1: Having Count A (1 to 10 position remaining spaces - 80 byte FB)
File2: Having Count B (1 to 10 position remaining spaces - 80 byte FB)
File3: Having Count C (1 to 10 position remaining spaces - 80 byte FB)
File4: Having Cycle Date (date @ 46 to 53 position - 80 byte FB)

Output file: Should have Single record - 80 byte FB

Date Count A Count B Count C
(1to8) (5space) (14-23) (5space) (29-38) (5space) (44-53)(54-80 space)
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Nov 03, 2009 11:18 pm
Reply with quote

jvsamycts,

use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=Your input fb 80 file1,DISP=SHR
           DD DSN=Your input fb 80 file2,DISP=SHR
           DD DSN=Your input fb 80 file3,DISP=SHR
           DD DSN=Your input fb 80 file4,DISP=SHR
//SORTOUT  DD SYSOUT=*                                         
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,10,46,8,SEQNUM,1,ZD,38C'0')),
  IFTHEN=(WHEN=(19,1,ZD,EQ,1),OVERLAY=(20:1,10)),               
  IFTHEN=(WHEN=(19,1,ZD,EQ,2),OVERLAY=(30:1,10)),               
  IFTHEN=(WHEN=(19,1,ZD,EQ,3),OVERLAY=(40:1,10)),               
  IFTHEN=(WHEN=(19,1,ZD,EQ,4),OVERLAY=(50:11,8))               
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                         
  TRAILER1=(50,8,5X,TOT=(20,10,ZD,M11,LENGTH=10),5X,           
                    TOT=(30,10,ZD,M11,LENGTH=10),5X,           
                    TOT=(40,10,ZD,M11,LENGTH=10))               
//*
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 Nov 03, 2009 11:33 pm
Reply with quote

Here's another way to do it with DFSORT/ICETOOL:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//CON DD DSN=...  input file1 (FB/80)
//    DD DSN=...  input file2 (FB/80)
//    DD DSN=...  input file3 (FB/80)
//    DD DSN=...  input file4 (FB/80)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
SPLICE FROM(CON) TO(OUT) ON(80,1,CH) WITHANY -
  WITH(1,8) WITH(14,10) WITH(29,10) WITH(44,10) USING(CTL1)
/*
//CTL1CNTL DD *
  OPTION COPY
  INREC IFOUTLEN=80,
    IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,1,ZD)),
    IFTHEN=(WHEN=(81,1,CH,EQ,C'1'),BUILD=(14:1,10)),
    IFTHEN=(WHEN=(81,1,CH,EQ,C'2'),BUILD=(29:1,10)),
    IFTHEN=(WHEN=(81,1,CH,EQ,C'3'),BUILD=(44:1,10)),
    IFTHEN=(WHEN=(81,1,CH,EQ,C'4'),BUILD=(1:46,8))
/*
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top