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

Field concatenation on a record using SYNCSORT!!!


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajayjindal21
Warnings : 1

New User


Joined: 20 Jul 2007
Posts: 24
Location: Bangalore

PostPosted: Tue Sep 11, 2007 3:34 pm
Reply with quote

Hi All,

There is a problem that I am facing which I know that it can be resolved using DFSORT(SQZ function) but unfortunately we have SYNCSORT at our place.

The scenario is as follows:

There are three fields of the following length:44,06 & 02. The problem now is that I need to remove the spaces-1 between these three fields (if any; but retaining just one space).

Example:

Code:
INPUT:
----|----|----|----|----|----|----|----|----|----|----|----|----|----|
SYNCSORT                                    SORT  OK   

OUTPUT:
----|----|----|----|----|----|----|----|----|----|----|----|----|----|
SYNCSORT SORT OK


Here the SYNCSORT field is of 44 length, SORT field is of 6 length and OK field is of 2 length.

All this in SYNCSORT icon_cry.gif

Thank you all for your time on this
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 11, 2007 8:23 pm
Reply with quote

Hello,

If you need this quickly, i'd suggest you put together the bit of COBOL code needed to accomplish this.

It would be a read, a move (to clear the output area), a STRING delimited by space to populate the output area, and a write.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Sep 12, 2007 2:09 am
Reply with quote

ajayjindal21,

If you are interested in using the SQZ function in SyncSort for z/OS, please feel free to contact me offline at alissa.margulies@syncsort.com.

Regards,
Back to top
View user's profile Send private message
lcmontanez

New User


Joined: 19 Jun 2007
Posts: 50
Location: Chicago

PostPosted: Wed Sep 12, 2007 2:39 am
Reply with quote

if the sqz function is going to be used why not post the solution here.

Just in case other may want to use this in the future.
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Sep 12, 2007 4:48 pm
Reply with quote

ajayjindal21,

Please check with the following code for your requirement
Code:
// EXEC PGM=SORT                                                       
//SORTIN DD *                                                         
SYNCSORT                                    SORT  OK
/*                                                                     
//SORTOUT DD SYSOUT=*                                                 
//SYSOUT DD SYSOUT=*                                                   
//SYSIN DD *                                                           
 OPTION COPY                                                           
 INREC IFTHEN=(WHEN=INIT,BUILD=(1,52,53:X)),                           
       IFTHEN=(WHEN=(45,6,CH,EQ,C' '),BUILD=(1,44,51,2,53:X)),         
      IFTHEN=(WHEN=(50,1,CH,NE,C' '),BUILD=(1,44,45,6,C' ',51,2)),     
      IFTHEN=(WHEN=(49,1,CH,NE,C' '),BUILD=(1,44,45,5,C' ',51,2,53:X)),
      IFTHEN=(WHEN=(48,1,CH,NE,C' '),BUILD=(1,44,45,4,C' ',51,2,53:X)),
      IFTHEN=(WHEN=(47,1,CH,NE,C' '),BUILD=(1,44,45,3,C' ',51,2,53:X)),
      IFTHEN=(WHEN=(46,1,CH,NE,C' '),BUILD=(1,44,45,2,C' ',51,2,53:X)),
      IFTHEN=(WHEN=(45,1,CH,NE,C' '),BUILD=(1,44,45,1,C' ',51,2,53:X))
 OUTFIL IFOUTLEN=54,                                                   
        IFTHEN=(WHEN=(1,44,CH,EQ,C' '),BUILD=(45,9)),         
        IFTHEN=(WHEN=(44,1,CH,NE,C' '),BUILD=(1,44,C' ',45,9)),
        IFTHEN=(WHEN=(43,1,CH,NE,C' '),BUILD=(1,43,C' ',45,9)),
        IFTHEN=(WHEN=(42,1,CH,NE,C' '),BUILD=(1,42,C' ',45,9)),
        IFTHEN=(WHEN=(41,1,CH,NE,C' '),BUILD=(1,41,C' ',45,9)),
        IFTHEN=(WHEN=(40,1,CH,NE,C' '),BUILD=(1,40,C' ',45,9)),
        IFTHEN=(WHEN=(39,1,CH,NE,C' '),BUILD=(1,39,C' ',45,9)),
        IFTHEN=(WHEN=(38,1,CH,NE,C' '),BUILD=(1,38,C' ',45,9)),
        IFTHEN=(WHEN=(37,1,CH,NE,C' '),BUILD=(1,37,C' ',45,9)),
        IFTHEN=(WHEN=(36,1,CH,NE,C' '),BUILD=(1,36,C' ',45,9)),
        IFTHEN=(WHEN=(35,1,CH,NE,C' '),BUILD=(1,35,C' ',45,9)),
        IFTHEN=(WHEN=(34,1,CH,NE,C' '),BUILD=(1,34,C' ',45,9)),
        IFTHEN=(WHEN=(33,1,CH,NE,C' '),BUILD=(1,33,C' ',45,9)),
        IFTHEN=(WHEN=(32,1,CH,NE,C' '),BUILD=(1,32,C' ',45,9)),
        IFTHEN=(WHEN=(31,1,CH,NE,C' '),BUILD=(1,31,C' ',45,9)),
        IFTHEN=(WHEN=(30,1,CH,NE,C' '),BUILD=(1,30,C' ',45,9)),
        IFTHEN=(WHEN=(29,1,CH,NE,C' '),BUILD=(1,29,C' ',45,9)),
        IFTHEN=(WHEN=(28,1,CH,NE,C' '),BUILD=(1,28,C' ',45,9)),
        IFTHEN=(WHEN=(27,1,CH,NE,C' '),BUILD=(1,27,C' ',45,9)),
        IFTHEN=(WHEN=(26,1,CH,NE,C' '),BUILD=(1,26,C' ',45,9)),
        IFTHEN=(WHEN=(25,1,CH,NE,C' '),BUILD=(1,25,C' ',45,9)),
        IFTHEN=(WHEN=(24,1,CH,NE,C' '),BUILD=(1,24,C' ',45,9)),
        IFTHEN=(WHEN=(23,1,CH,NE,C' '),BUILD=(1,23,C' ',45,9)),
        IFTHEN=(WHEN=(22,1,CH,NE,C' '),BUILD=(1,22,C' ',45,9)),
        IFTHEN=(WHEN=(21,1,CH,NE,C' '),BUILD=(1,21,C' ',45,9)),
        IFTHEN=(WHEN=(20,1,CH,NE,C' '),BUILD=(1,20,C' ',45,9)),
        IFTHEN=(WHEN=(19,1,CH,NE,C' '),BUILD=(1,19,C' ',45,9)),
        IFTHEN=(WHEN=(18,1,CH,NE,C' '),BUILD=(1,18,C' ',45,9)),
        IFTHEN=(WHEN=(17,1,CH,NE,C' '),BUILD=(1,17,C' ',45,9)),
        IFTHEN=(WHEN=(16,1,CH,NE,C' '),BUILD=(1,16,C' ',45,9)),
        IFTHEN=(WHEN=(15,1,CH,NE,C' '),BUILD=(1,15,C' ',45,9)),
        IFTHEN=(WHEN=(14,1,CH,NE,C' '),BUILD=(1,14,C' ',45,9)),
        IFTHEN=(WHEN=(13,1,CH,NE,C' '),BUILD=(1,13,C' ',45,9)),
        IFTHEN=(WHEN=(12,1,CH,NE,C' '),BUILD=(1,12,C' ',45,9)),
        IFTHEN=(WHEN=(11,1,CH,NE,C' '),BUILD=(1,11,C' ',45,9)),
        IFTHEN=(WHEN=(10,1,CH,NE,C' '),BUILD=(1,10,C' ',45,9)),
        IFTHEN=(WHEN=(09,1,CH,NE,C' '),BUILD=(1,09,C' ',45,9)),
        IFTHEN=(WHEN=(08,1,CH,NE,C' '),BUILD=(1,08,C' ',45,9)),
        IFTHEN=(WHEN=(07,1,CH,NE,C' '),BUILD=(1,07,C' ',45,9)),
        IFTHEN=(WHEN=(06,1,CH,NE,C' '),BUILD=(1,06,C' ',45,9)),
        IFTHEN=(WHEN=(05,1,CH,NE,C' '),BUILD=(1,05,C' ',45,9)),
        IFTHEN=(WHEN=(04,1,CH,NE,C' '),BUILD=(1,04,C' ',45,9)),
        IFTHEN=(WHEN=(03,1,CH,NE,C' '),BUILD=(1,03,C' ',45,9)),
        IFTHEN=(WHEN=(02,1,CH,NE,C' '),BUILD=(1,02,C' ',45,9)),
        IFTHEN=(WHEN=(01,1,CH,NE,C' '),BUILD=(1,01,C' ',45,9))
/* 
// 

Output:
Code:
SYNCSORT SORT OK
Back to top
View user's profile Send private message
ajayjindal21
Warnings : 1

New User


Joined: 20 Jul 2007
Posts: 24
Location: Bangalore

PostPosted: Wed Sep 12, 2007 5:55 pm
Reply with quote

Thank You Shankar,

I managed to write a COBOL code for this requirement, but I found that SORT was very much quicker in terms of performance.

Thank You Shankar, Alissa, Dick & lcmontanez, thank you all
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Sep 12, 2007 11:09 pm
Reply with quote

lcmontanez wrote:
if the sqz function is going to be used why not post the solution here.

The SQZ function is available in SyncSort for z/OS 1.3, which is currently in Early Support. If anyone is interested in participating in our Early Support Program, please feel free to contact me offline.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top