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
 

 

File Concatenation - SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: File Concatenation - SORT
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    Post subject:
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 Moderator


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

PostPosted: Tue Nov 03, 2009 11:33 pm    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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