View previous topic :: View next topic
|
Author |
Message |
sprasannapathy
New User
Joined: 04 Jan 2008 Posts: 42 Location: india
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sprasannapathy
New User
Joined: 04 Jan 2008 Posts: 42 Location: india
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sprasannapathy
New User
Joined: 04 Jan 2008 Posts: 42 Location: india
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sprasannapathy
New User
Joined: 04 Jan 2008 Posts: 42 Location: india
|
|
|
|
Is there any other approach…….. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
sprasannapathy,
You have mentioned the field-2 length as 14 in your initial post. But "Vengatachalapathy" is having more than that |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
|