View previous topic :: View next topic
|
Author |
Message |
ranjithmainframe
New User
Joined: 21 Jan 2008 Posts: 39 Location: chennai
|
|
|
|
Hi,
Can anyone help in this regard.
I have the input file as below. I need to write out the value from the file before the
first delimiter ',' (dot). The values are in different length as mentioned.
Code: |
,BROWSE ,RRS.UPALPHA.V080820.ALLDTL ,Line,00000000,Col,001 080,
,Command ===>, ,Scroll ===>,CSR ,
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
ROPA417.ROPA SIETE LEGUAS SA DE CV $.417 UNION PACIFIC..Laredo.TX.78045.21088686
REDK27.RED KAP DE MEXICO¬SA DE CV.CIRCUITO CENTRAL #27 P.I.L..RFC: RKM970925Q70.
REDK27.RED KAP DE MEXICO¬SA DE CV.CIRCUITO CENTRAL #27 P.I.L..RFC: RKM970925Q70.
GETR3105.GE Transportation Systems¬.3105 Main Ave..Erie.PA.16531.173004045.
WERN68145.WERNER ENTERPRISE.P O BOX 45308.ATTN: ACCOUNT PAYABLES.OMAHA.NE.68145
TRES5350.TRESONS INTERNATIONAL.5350 MAIN STREET.COSIMO POLINO.Buffalo.NY.14221.7 |
Hence my output should be as follows,
Code: |
ROPA417
REDK27
REDK27
GETR3105
WERN68145
TRES5350 |
Ranjith |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. I assumed the maximum length for the field before the dot is 9, but you can replace FIXLEN=9 with FIXLEN=n where n is the maximum length you need.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC PARSE=(%01=(ENDBEFR=C'.',FIXLEN=9)),
BUILD=(%01)
/*
|
|
|
Back to top |
|
|
ranjithmainframe
New User
Joined: 21 Jan 2008 Posts: 39 Location: chennai
|
|
|
|
Thanks Frank for your response.
I get an error for the below code,
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=RRS.UPALPHA.V080820.ALLDTL,DISP=SHR
//SORTOUT DD DSN=RRS.UPALPHA.V080820.PARSED,DISP=SHR
//SYSIN DD *
INREC PARSE=(%01=(ENDBEFR=C'.',FIXLEN=10)),
BUILD=(%01)
/* |
Error is
Code: |
SYNCSORT FOR Z/OS 1.2.3.1R U.S. PATENTS: 4210961, 5117495 (C)
DUN & BRADSTREET - NBIC-ISM z
PRODUCT LICENSED FOR CPU SERIAL NUMBER 5D0EC, MODEL 2064 103
SYSIN :
INREC PARSE=(%01=(ENDBEFR=C'.',FIXLEN=10)),
*
BUILD=(%01)
WER901I **WARNING** SYNCSORT 1.2.3.1 WILL EXPIRE IN 21 DAYS
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000 |
I am trying to resolve the error!!!
Thanks,
Ranjith |
|
Back to top |
|
|
ranjithmainframe
New User
Joined: 21 Jan 2008 Posts: 39 Location: chennai
|
|
|
|
Frank,
I have missed the OPTION parameter,
But anyway I get an same error..
********************************* TOP OF DATA ********************
SYNCSORT FOR Z/OS 1.2.3.1R U.S. PATENTS: 4210961, 5117495 (
Code: |
DUN & BRADSTREET - NBIC-ISM
PRODUCT LICENSED FOR CPU SERIAL NUMBER 5D0EC, MODEL 2064 103
SYSIN :
OPTION COPY
INREC PARSE=(%01=(ENDBEFR=C'.',FIXLEN=10)),
*
BUILD=(%01)
WER901I **WARNING** SYNCSORT 1.2.3.1 WILL EXPIRE IN 21 DAYS
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
******************************** BOTTOM OF DATA ****************** |
Thanks,
Ranjith |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Ranjith,
You are using SYNCSORT and not DFSORT. The solution provided works only for DFSORT and not for your SYNCSORT version.
Thanks,
Arun |
|
Back to top |
|
|
ranjithmainframe
New User
Joined: 21 Jan 2008 Posts: 39 Location: chennai
|
|
|
|
Arun,
Could you please suggest alternative way to do this in SYNCSORT.
Thanks,
Ranjith |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you install the current release of Syncsort (1.3), PARSE is supported. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Ranjith,
PARSE function works only with SYNCSORT for z/OS 1.3
Thanks,
Arun |
|
Back to top |
|
|
ranjithmainframe
New User
Joined: 21 Jan 2008 Posts: 39 Location: chennai
|
|
|
|
Yes..
I got it.. SYNCSORT 1.3 will support PARSE. But I am trying to solve my issue using anyother SYNCSORT tools of existing version since I don't have option to install SYNCSORT 1.3 unfortunately. It would be more helpful if I get any hints to solve my problem using any tools/function in SORT other than PARSE function.
Thanks,
Ranjith |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If your management is not willing to upgrade Syncsort at this time, you could always write the trivial bit of cobol code needed to do this. . . |
|
Back to top |
|
|
ranjithmainframe
New User
Joined: 21 Jan 2008 Posts: 39 Location: chennai
|
|
|
|
Yes dick scherrer,
I have to go for COBOL in this case!!
Thanks,
Ranjith |
|
Back to top |
|
|
|