Moving the record



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Moving the record

Postby ranga_subham » Mon Oct 20, 2008 9:05 pm

Hi,

Would you please tell me how to achieve it using SORT?

Input:
AAA
BBB
CCC


Expected Output:

AAA     
   BBB   
      CCC


Thank you.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Moving the record

 

Re: Moving the record

Postby Alissa Margulies » Tue Oct 21, 2008 12:18 am

Try the following:
//SORT     EXEC PGM=SORT                 
//SORTIN   DD *
AAA
BBB
CCC
//SORTOUT  DD DSN=OUTPUT.DATA                                     
//SYSOUT   DD SYSOUT=*                                     
//SYSIN    DD *                         
    SORT FIELDS=COPY                       
    OUTREC IFTHEN=(WHEN=INIT,             
      OVERLAY=(10:SEQNUM,1,ZD)),     
      IFTHEN=(WHEN=(10,1,CH,EQ,C'1'),
      BUILD=(1:1,3,6Z)),             
      IFTHEN=(WHEN=(10,1,CH,EQ,C'2'),
      BUILD=(3Z,4:1,3,3Z)),           
      IFTHEN=(WHEN=(10,1,CH,EQ,C'3'),
      BUILD=(6Z,7:1,3))
/*
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Moving the record

Postby ranga_subham » Tue Oct 21, 2008 3:12 pm

Excellent...........thanks Alissa.....

Does the 3Z or 6Z use zeros?
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Disadvantages with this job !

Postby ranga_subham » Tue Oct 21, 2008 3:41 pm

Alissa, With the below job I could produce the same.

//STEP0002 EXEC PGM=SORT                               
//SORTIN   DD *                                         
AAA                                                     
BBB                                                     
CCC                                                     
/*                                                     
//SORTOUT  DD SYSOUT=*                                 
//SYSOUT   DD SYSOUT=*                                 
//SYSIN    DD *                                         
 SORT FIELDS=COPY                                       
 OUTREC IFTHEN=(WHEN=(1,3,CH,EQ,C'AAA'),BUILD=(1,3)),   
        IFTHEN=(WHEN=(1,3,CH,EQ,C'BBB'),BUILD=(3X,1,3)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'CCC'),BUILD=(6X,1,3))
/*


Please let me know if this is incorrect and the disadvantages.

Thanks for your time.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Disadvantages with this job !

Postby ranga_subham » Tue Oct 21, 2008 5:59 pm

I am very sorry for creating a new post instead of replying to "Moving the record". :shock:

I request the moderator to combine this into "Moving the record". :|

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Moving the record

Postby Alissa Margulies » Tue Oct 21, 2008 7:36 pm

ranga_subham wrote:Does the 3Z or 6Z use zeros?

Yes, they are X'00'. If you would prefer actual blanks (X'40'), then in this application, you can specify 3X or 6X.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Moving the record

Postby ranga_subham » Tue Oct 21, 2008 8:48 pm

Thanks for the info.......
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post