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
 

 

Combining inputs using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Combining inputs using DFSORT
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    Post subject:
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    Post subject:
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    Post subject:
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: 578
Location: USA

PostPosted: Tue Sep 14, 2010 8:10 pm    Post subject:
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    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 DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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