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

Parse a file thru Sync sort or EZT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Tue Aug 14, 2007 1:40 am
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
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: 3156
Location: Tucson AZ

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

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

Moderator Emeritus


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

PostPosted: Tue Aug 14, 2007 6:29 pm
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
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

Moderator Emeritus


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

PostPosted: Thu Aug 16, 2007 6:31 pm
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 Developer


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

PostPosted: Thu Aug 16, 2007 8:55 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top