Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sortout the field based on delimiter

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Sortout the field based on delimiter
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 Moderator


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

PostPosted: Wed Aug 20, 2008 11:41 pm    Post subject:
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    Post subject: Reply to: Sortout the field based on delimiter
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    Post subject: Reply to: Sortout the field based on delimiter
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: 2284
Location: @my desk

PostPosted: Thu Aug 21, 2008 12:07 am    Post subject:
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    Post subject: Reply to: Sortout the field based on delimiter
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

Site Director


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

PostPosted: Thu Aug 21, 2008 12:36 am    Post subject:
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: 2284
Location: @my desk

PostPosted: Thu Aug 21, 2008 12:40 am    Post subject:
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    Post subject: Reply to: Sortout the field based on delimiter
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

Site Director


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

PostPosted: Thu Aug 21, 2008 7:44 pm    Post subject:
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    Post subject: Reply to: Sortout the field based on delimiter
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    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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us