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

Combining inputs using DFSORT


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

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Tue Sep 14, 2010 12:50 pm
Reply with quote

Hi
I have an input file with character and numeric data.

I/p:

AAA
BBB
CCC
111
222
333

The o/p should be :
AAA111
BBB222
CCC333

i.e. the corresponding alphabet and numeric data should appear together in the output file.

Please let me know how to do this using DFSORT.
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Tue Sep 14, 2010 12:54 pm
Reply with quote

how many such alphabetic sequence are u expecting ,

are all the non numeric data grouped together

can the data be like

AAA
CCC
BBB
111
222
333

in such a case wat wud be ur o/p
Back to top
View user's profile Send private message
Ambili S

Active User


Joined: 06 Sep 2007
Posts: 112
Location: India

PostPosted: Tue Sep 14, 2010 12:59 pm
Reply with quote

yes the data can be as u mentioned . The o/p should be like , the 1st Alphabet should be combined with 1st Numeric data , 2nd alphabet with 2nd numeric and so on. And for any alphabet there's no corresponding numeric then it should appear as it is.
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Tue Sep 14, 2010 2:20 pm
Reply with quote

Code:
//S1   EXEC  PGM=ICETOOL                                         
//FILE1  DD *                                                     
AAA                                                               
BBB                                                               
CCC                                                               
111                                                               
222                                                               
333                                                               
//FILEOUT DD DSN=TEMP.TLM.TEST.DEL3,                             
//          DISP=(NEW,CATLG),UNIT=DISK,                           
//          SPACE=(27998,(400,100),RLSE)                         
//TEMP    DD  SPACE=(27998,(400,100),RLSE),                       
//          DISP=(,PASS),UNIT=DISK                               
//TOOLMSG DD SYSOUT=*                                             
//DFSMSG DD SYSOUT=*                                             
//TOOLIN DD *                                                     
   COPY FROM(FILE1) TO(TEMP) USING(CTL1)                         
   SPLICE FROM(TEMP) TO(FILEOUT) ON(30,2,CH) WITH(4,3) -         
      WITHANY USING(CTL2)                                         
/*                                                               
//CTL1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=(1,3,ZD,NE,NUM),OVERLAY=(30:SEQNUM,2,ZD)),   
      IFTHEN=(WHEN=(1,3,ZD,EQ,NUM),OVERLAY=(4:1,3,1:3X,30:SEQNUM,2,ZD))
//CTL2CNTL DD *                                                         
   OUTFIL BUILD=(1,29)                                                 
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Sep 14, 2010 8:10 pm
Reply with quote

Ambili S,
Here is the single pass method with similar logic. I am assuming 80 byte input file.
Code:

//STEP01   EXEC  PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//IN     DD *                                                     
AAA                                                               
BBB                                                               
CCC                                                               
111                                                               
222                                                               
333                                                               
444                                                               
//OUT DD SYSOUT=*                                                 
//TOOLIN   DD *                                                   
SPLICE FROM(IN) TO(OUT) ON(81,2,CH) WITHANY KEEPNODUPS -         
    WITH(4,3) USING(CTL1)                                         
/*                                                               
//CTL1CNTL DD *                                                   
 INREC IFTHEN=(WHEN=(1,3,ZD,NE,NUM),OVERLAY=(81:SEQNUM,2,ZD)),   
       IFTHEN=(WHEN=NONE,OVERLAY=(4:1,3,1:3X,81:SEQNUM,2,ZD))     
 OUTFIL BUILD=(1,80)                                             
/*                                                               

OUTPUT
Code:

AAA111
BBB222
CCC333
   444


Thanks,
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top