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
 
Parse a file thru Sync sort or EZT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
gprerna

New User


Joined: 21 Mar 2007
Posts: 38
Location: US

PostPosted: Tue Aug 14, 2007 1:23 am    Post subject: Parse a file thru Sync sort or EZT
Reply with quote

Hi,

I have a requirement where in, i have a file with below data:


Code:
ERROR SUDIPTA ABCDEFGH
    ERROR SUDIPTA ABC   
               ERROR SUDIPTA 
    ERROR NEHA ABCDE             
          ERROR SUDIPTA AB   



In the output file i want the output as:

Code:
ABCDEFGH
ABC
AB



is there a way to do this thru a sync sort. I tried to use the below code:

Code:
//SYSIN    DD *                       
  SORT FIELDS=COPY                   
  INCLUDE COND=(1,80,SS,EQ,C'SUDIPTA')


but the output is not as what i expected. It gave me the below o/p:

Code:
ERROR SUDIPTA ABCDEFGH
    ERROR SUDIPTA ABC   
               ERROR SUDIPTA               
          ERROR SUDIPTA AB   



Please let me know how we can handle this either thru a sync sort or thru a EZT.

Thanks!
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: Tue Aug 14, 2007 1:40 am    Post subject:
Reply with quote

Hello,

You "told" the sort to include every record containing SUDIPTA - that is what it did.

For us to be able to provide anything usefull (unless someone makes a lucky guess) you need to clearly describe your "rule(s). You need to explain why the desired output is desired (rather than what you received that does not meet your requirement).
Back to top
View user's profile Send private message
gprerna

New User


Joined: 21 Mar 2007
Posts: 38
Location: US

PostPosted: Tue Aug 14, 2007 1:42 am    Post subject: Re: Parse a file thru Sync sort or EZT
Reply with quote

yes, thats what the sort did. For my requirement the o/p should be:

In the output file i want the output as:

Code:

ABCDEFGH
ABC
AB
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Aug 14, 2007 1:52 am    Post subject:
Reply with quote

Like Dip, he wants it parsed....
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: Tue Aug 14, 2007 1:54 am    Post subject:
Reply with quote

Hello,

I believe we understand what you want as output. . . .

Now, you need to explain what the rules are to get there using your input data.

You looked at your data and "knew" what the output should be. We don't "know" and you need to explain in detail what caused you to choose that particular set of output.

If the requirement includes more than what you've posted, you need to include that as well.
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Tue Aug 14, 2007 8:28 am    Post subject:
Reply with quote

You mentioned that whichever records are having SUDIPTA will be selected.

Then 3rd line
Code:
ERROR SUDIPTA
also should be selected right?
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: Tue Aug 14, 2007 6:29 pm    Post subject:
Reply with quote

Hello,

I believe it should not be selected.

Hopefully, we will get the "rules" and then maybe we can help. . . .
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Thu Aug 16, 2007 4:30 pm    Post subject:
Reply with quote

I guess the output file will contain the the data followed by SUDIPTA...if this is the req. And I think as the position of SUDIPTA is varying...capturing teh data followed by SUDIPTA would be difficult using JCL...can DFSORT/ICETOOL can handle this....I hope Frank can answer this...Master in DFSORT....:-)!!!
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 16, 2007 6:31 pm    Post subject:
Reply with quote

Hello,

Until the complete "rules" are posted, any suggestions/solutions are just a guess.

Maybe the rules will be posted. . . .
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: Thu Aug 16, 2007 8:55 pm    Post subject:
Reply with quote

Quote:
can DFSORT/ICETOOL can handle this


Yes, with DFSORT's PARSE function. For example, let's say the requirement is to get each nonblank value after 'SUDIPTA ' and the value can be a maximum of 10 bytes. This DFSORT job would do it.

Code:

//S1    EXEC  PGM=ICEMAN                                     
//SYSOUT    DD  SYSOUT=*                                     
//SORTIN DD *                                                 
ERROR SUDIPTA ABCDEFGH                                       
    ERROR SUDIPTA ABC                                         
               ERROR SUDIPTA                                 
    ERROR NEHA ABCDE                                         
          ERROR SUDIPTA AB                                   
/*
//SORTOUT DD SYSOUT=*                                         
//SYSIN    DD    *                                           
  OPTION COPY                                                 
  INCLUDE COND=(1,80,SS,EQ,C'SUDIPTA')                       
  INREC PARSE=(%01=(STARTAFT=C'SUDIPTA ',FIXLEN=10)),         
    BUILD=(%01,80:X)                                         
  OUTFIL OMIT=(1,10,CH,EQ,C' ')                               
/*
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

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