Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Syncsort - Combining two fields by adding delimiter in sort.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Combining two fields by adding delimiter in sort.
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 Moderator


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

PostPosted: Fri Aug 14, 2009 10:25 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat Aug 15, 2009 10:26 pm    Post subject:
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

Site Director


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

PostPosted: Sun Aug 16, 2009 7:19 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Aug 19, 2009 7:38 pm    Post subject:
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    Post subject:
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: 2287
Location: @my desk

PostPosted: Thu Aug 20, 2009 3:23 pm    Post subject:
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: 2287
Location: @my desk

PostPosted: Thu Aug 20, 2009 4:14 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us