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

Sortout the field based on delimiter


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

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Wed Aug 20, 2008 10:38 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Aug 20, 2008 11:41 pm
Reply with quote

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
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Thu Aug 21, 2008 12:00 am
Reply with quote

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
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Thu Aug 21, 2008 12:02 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Aug 21, 2008 12:07 am
Reply with quote

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
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Thu Aug 21, 2008 12:13 am
Reply with quote

Arun,

Could you please suggest alternative way to do this in SYNCSORT.

Thanks,
Ranjith
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: Thu Aug 21, 2008 12:36 am
Reply with quote

Hello,

If you install the current release of Syncsort (1.3), PARSE is supported.
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 21, 2008 12:40 am
Reply with quote

Ranjith,

PARSE function works only with SYNCSORT for z/OS 1.3 icon_sad.gif

Thanks,
Arun
Back to top
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Thu Aug 21, 2008 10:50 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Aug 21, 2008 7:44 pm
Reply with quote

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
View user's profile Send private message
ranjithmainframe

New User


Joined: 21 Jan 2008
Posts: 39
Location: chennai

PostPosted: Thu Aug 21, 2008 11:50 pm
Reply with quote

Yes dick scherrer,

I have to go for COBOL in this case!!

Thanks,
Ranjith
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
Search our Forums:

Back to Top