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

Syncsort - Combining two fields by adding delimiter in sort.


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

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Fri Aug 14, 2009 9:37 pm
Reply with quote

Could someone help me?

I have got input records as below

Code:
Field1 – length 15                        Field2 – Length 14
<------------------->                     <--------------------->
Prasannaa S                               Vengatachalapathy
Sashi                                     Kalasanna
Prince Yardley                            Kumar


Now I need the output as

Field1 – length 30
<--------------------------------------->
Prasannaa S,Vengatachalapathy
Sashi,Kalasanna
Prince Yardley,Kumar


When I tried to use SQZ (Squeeze out blanks or other characters)

Code:
OPTION COPY
INREC BUILD=(1,48,SQZ=(SHIFT=LEFT,MID=C','))


I am getting out put as below. It has got multiple comma(,), it hsould not happen.

Prasannaa,S,Vengatachalapathy
Sashi,Kalasanna
Prince,Yardley, Kumar

Because of blank spaces in Field 1

When I tried with PARSE it is expecting FIXLEN. I am unable to specify the value because the output field is variable.


Kindly any of you can help me?

I am thanking the mainframe forum for building my knowledge and confidence level.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Aug 14, 2009 10:25 pm
Reply with quote

You can use a DFSORT job like the following tol do what you asked for.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
Prasannaa S                    Vengatachalapathy
Sashi                          Kalasanna
Prince Yardley                 Kumar
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=48,
   IFTHEN=(WHEN=INIT,
    OVERLAY=(1:1,15,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',
      LENGTH=17),
      1:1,48,SQZ=(SHIFT=LEFT,MID=C',',PAIR=QUOTE))),
   IFTHEN=(WHEN=INIT,FINDREP=(IN=C'"',OUT=C''))
/*
Back to top
View user's profile Send private message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Sat Aug 15, 2009 4:01 pm
Reply with quote

Thanking for reply.

When we tried with given coding we are getting a user abend U0016.
Code:

-JOBNAME  STEPNAME PROCSTEP    RC   EXCP   CONN 
-BSSORT   S1                U0016     28      7 

Please find the error message below.

Code:

SYSIN :                                                             
  OPTION COPY                                                       
  INREC IFOUTLEN=48,                                                 
   IFTHEN=(WHEN=INIT,                                               
    OVERLAY=(1:1,15,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',           
      LENGTH=17),                                                   
      1:1,48,SQZ=(SHIFT=LEFT,MID=C',',PAIR=QUOTE))),                 
   IFTHEN=(WHEN=INIT,FINDREP=(IN=C'"',OUT=C''))                     
                     *                                               
WER268A  INREC STATEMENT   : SYNTAX ERROR                           
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                       

Kindly help…..


Thanks
Prasannaa S
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Aug 15, 2009 10:26 pm
Reply with quote

My job works fine with DFSORT. But the WER messages indicate you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
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: Sun Aug 16, 2009 7:19 am
Reply with quote

Hello,

Now that you understand that you are using the Syncsort product, which release is being used?

It sounds like your system is not running the current release. . .
Back to top
View user's profile Send private message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Wed Aug 19, 2009 12:16 pm
Reply with quote

Thanking you for the reply.

I have given the version below. Is there any other approach……..

Code:
SYNCSORT FOR Z/OS  1.3.0.1RI   U.S. PATENTS: 4210961, 5117495   (C) 2007  SYNCSORT INC.   DATE=2009/230   TIME=07.21.32 




Thanks
Prasannaa S
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: Wed Aug 19, 2009 7:38 pm
Reply with quote

Hello,

While the release you are using is fairly current (1.3.0.1), it does not have FINDREP.

Quote:
support for FINDREP was included in release 1.3.2.1


Possibly the current release could be installed for testing. . .
Back to top
View user's profile Send private message
sprasannapathy

New User


Joined: 04 Jan 2008
Posts: 42
Location: india

PostPosted: Thu Aug 20, 2009 1:07 pm
Reply with quote

Is there any other approach……..
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Aug 20, 2009 3:23 pm
Reply with quote

sprasannapathy,

You have mentioned the field-2 length as 14 in your initial post. But "Vengatachalapathy" is having more than that icon_rolleyes.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Aug 20, 2009 4:14 pm
Reply with quote

Quote:
Is there any other approach
This can be achieved in a few lines of code in REXX like this.

Your.rexx.library(member)
Code:
/* REXX */                                                       
"EXECIO * DISKR INDD ( STEM INP. FINIS"                           
B = 1                                                             
DO A = 1 TO INP.0                                                 
   OUT.B = STRIP(SUBSTR(INP.A,1,15)) || ',' || SUBSTR(INP.A,32,17)
   B = B + 1                                                     
END                                                               
"EXECIO * DISKW OUTDD ( STEM OUT. FINIS"                         
EXIT
Run JCL
Code:
//STEP1    EXEC PGM=IKJEFT01,PARM='member'   
//SYSEXEC  DD DSN=Your.rexx.library,DISP=SHR
//SYSTSIN  DD DUMMY                         
//SYSTSPRT DD SYSOUT=*                       
//INDD     DD DSN= Input-file  (FB/80)       
//OUTDD    DD DSN= Output-file (FB/80)     
Input-file
Code:
----+----1----+----2----+----3----+----4----+---
***************************** Top of Data ******
Prasannaa S                    Vengatachalapathy
Sashi                          Kalasanna       
Prince Yardley                 Kumar
Output-file
Code:
----+----1----+----2----+----
*****************************
Prasannaa S,Vengatachalapathy
Sashi,Kalasanna             
Prince Yardley,Kumar
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
Search our Forums:

Back to Top