MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syncsort-Connect the strings horizontallly

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
tempuser
Beginner


Joined: 05 Oct 2005
Posts: 28
Topics: 20
Location: INDORE

PostPosted: Fri Sep 29, 2006 2:50 am    Post subject: Syncsort-Connect the strings horizontallly Reply with quote

Hi,
Is it possible to connect the diffrent strings horizontally.The file is FB of length 133.

Code:


----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
                       22000891  ; COMPN=68.                           
                      VALUE1 22123417.80                               
                      VALUE2 22222460.08                               
                      VALUE3 22222530.98                               
                      VALUE4 22222629.81  VALUE6 22222219.82           
                      VALUE5 22222729.81                               
                       22000900  ; COMPN=68.                           
                      VALUE1 22222222.80                               
                      VALUE2 22222220.08                               
                      VALUE3 12345620.98                               
                      VALUE4 89781209.81  VALUE6 22222229.82           
                      VALUE5 54678129.81                               



I want the o/p like below.

Code:

COMPN    A/C NUM   VAL1        VAL2        ....VAL6           
68       22000891  22222460.08 22222460.08     22222219.82     
68       22000900  22222222.80 22222220.08     22222229.82     


Note : The max size of COMPN is 2 ,A/C NUM is 10 VALx is 11

Thank u
Back to top
View user's profile Send private message
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Thu Oct 05, 2006 2:03 pm    Post subject: Reply with quote

Hi Kolusu,
I don't see the reply for this question.I beleive this cant be achived thru sort.

Any comments ?
Thank you
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Oct 05, 2006 2:16 pm    Post subject: Reply with quote

Quote:
don't see the reply for this question.I beleive this cant be achived thru sort.



bprasanna,

It can be done , but the only problem is you need the latest version of syncsort which supports IFTHEN . I am just lazy to code an alternate solution with the old features.

with old features you need to split the input file into 6 files each depending on the value. And then concatenate them together to get the results.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Oct 05, 2006 5:10 pm    Post subject: Reply with quote

bprasanna,

If you are interested here is a one pass step with DFSORT/ICETOOL to get the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG   DD SYSOUT=*                                     
//DFSMSG    DD SYSOUT=*                                     
//IN        DD *                                           
                       22000891  ; COMPN=68.               
                      VALUE1 22123417.80                   
                      VALUE2 22222460.08                   
                      VALUE3 22222530.98                   
                      VALUE4 22222629.81  VALUE6 22222219.82
                      VALUE5 22222729.81                   
                       22000900  ; COMPN=68.               
                      VALUE1 22222222.80                   
                      VALUE2 22222220.08                   
                      VALUE3 12345620.98                   
                      VALUE4 89781209.81  VALUE6 22222229.82
                      VALUE5 54678129.81                   
//OUT       DD SYSOUT=*                                     
//TOOLIN    DD *                     
  SPLICE FROM(IN) TO(OUT) WITHEACH - 
      ON(93,8,CH)                  - 
    WITH(20,12)                    - 
    WITH(32,12)                    - 
    WITH(44,12)                    - 
    WITH(56,24)                    - 
    WITH(80,12)                    - 
   KEEPNODUPS USING(CTL1)             
//CTL1CNTL  DD *                     
  INREC IFTHEN=(WHEN=INIT,                           
         BUILD=(001:100X,                             
                101:36,08,                           
                110:24,08,                           
                140:23,45)),                         
        IFTHEN=(WHEN=(101,05,CH,EQ,C'COMPN'),         
       OVERLAY=(01:107,02,                           
                08:110,08,                           
                93:SEQNUM,8,ZD)),                     
        IFTHEN=(WHEN=(140,06,CH,EQ,C'VALUE1'),       
       OVERLAY=(20:147,11,93:SEQNUM,8,ZD)),           
        IFTHEN=(WHEN=(140,06,CH,EQ,C'VALUE2'),       
       OVERLAY=(32:147,11,93:SEQNUM,8,ZD)),           
        IFTHEN=(WHEN=(140,06,CH,EQ,C'VALUE3'),       
       OVERLAY=(44:147,11,93:SEQNUM,8,ZD)),           
        IFTHEN=(WHEN=(140,06,CH,EQ,C'VALUE4'),       
       OVERLAY=(56:147,11,93:SEQNUM,8,ZD),HIT=NEXT), 
        IFTHEN=(WHEN=(160,06,CH,EQ,C'VALUE6'),       
       OVERLAY=(68:167,11,93:SEQNUM,8,ZD)),           
        IFTHEN=(WHEN=(140,06,CH,EQ,C'VALUE5'),       
       OVERLAY=(80:147,11,93:SEQNUM,8,ZD))         
                                                   
  OUTFIL FNAMES=OUT,REMOVECC,                     
  OUTREC=(01,67,                                   
          80,12,                                   
          68,12),                                 
  HEADER2=(01:C'COMPN',                           
           08:C'A/C NUM',                         
           20:C'VALUE-01',                         
           32:C'VALUE-02',                         
           44:C'VALUE-03',                         
           56:C'VALUE-04',                         
           68:C'VALUE-05',                         
           80:C'VALUE-06',/,                       
           01:C'=====',                           
           08:C'=======',                         
           20:C'========',                         
           32:C'========',                         
           44:C'========',                         
           56:C'========',   
           68:C'========',   
           80:C'========')   
/*                           


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Fri Oct 06, 2006 4:35 am    Post subject: Reply with quote

Hi Kolusu,
You are great! Thanks a lot !

Thank you
bprasanna
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group