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

Extract first 2 Qualifiers from the record


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

New User


Joined: 27 Aug 2008
Posts: 8
Location: Chennai

PostPosted: Thu Oct 16, 2008 12:52 pm
Reply with quote

i want to extract first 2 Qualifiers from the record

The input is:


SYS3.AACICS.CO.SKFXAUTH M4NYTC PO U 0 184
CATALOG.VCATTTT
SYS3.AACICS.CO.SKFXCLIB M4NYTC PO U 0 184
CATALOG.VCATTTT
SYS3.AACICS.CO.SKFXDSCT M4NYTC PO FB 80 279
CATALOG.VCATTTT
SYS3.AACICS.CO.SKFXLOAD M4NYTC PO U 0 184
CATALOG.VCATTTT
SYS3.AAVIEW.CN.SKAZAUTH M4NYTC PO U 0 327
CATALOG.VCATTTT


the output should be:

SYS3.AACICS
SYS3.AAVIEW
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Oct 16, 2008 12:58 pm
Reply with quote

Is there a question in here, or just a statement of intent ?
Back to top
View user's profile Send private message
harunnisa

New User


Joined: 27 Aug 2008
Posts: 8
Location: Chennai

PostPosted: Thu Oct 16, 2008 1:11 pm
Reply with quote

Hi,

My infile is containg records as follows.

SYS3.AACICS.CO.SKFXAUTH M4NYTC PO U 0 184
CATALOG.VCATTTT
SYS3.AACICS.CO.SKFXCLIB M4NYTC PO U 0 184
CATALOG.VCATTTT
SYS3.AACICS.CO.SKFXDSCT M4NYTC PO FB 80 279
CATALOG.VCATTTT
SYS3.AACICS.CO.SKFXLOAD M4NYTC PO U 0 184
CATALOG.VCATTTT
SYS3.AAVIEW.CN.SKAZAUTH M4NYTC PO U 0 327
CATALOG.VCATTTT
SYS3.ABENDAID.CN.SKAZAUTH M4NYTC PO U 0 327
CATALOG.VCATTTT





I need to get my outfile should be as follows without duplicates.


SYS3.AACICS
SYS3.AAVIEW
SYS3.ABENDAID


Could you please help me to get the result by using SORT- JCL?

Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Oct 16, 2008 2:06 pm
Reply with quote

Quote:
Could you please help me to get the result by using SORT- JCL?

Yes. But you need to answer a few questions. Are all your HLQs = "SYS3" or do you expect other qualifiers also? If YES, Are they of the same length?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Oct 16, 2008 2:21 pm
Reply with quote

I assume first part is DSN names so each qualifier can have max length of 8

Code:

//TOOLIN DD *                                     
  COPY FROM(IN) TO(OUT) USING(CTL1)               
/*                                                 
//CTL1CNTL  DD  *                                 
   SORT FIELDS=(1,9,CH,A,10,8,CH,A)               
   SUM FIELDS=NONE                                 
   OMIT COND=(1,15,CH,EQ,C'CATALOG.VCATTTT')       
   INREC  PARSE=(%00=(FIXLEN=8,ENDBEFR=C'.'),     
              %01=(FIXLEN=8,ENDBEFR=C'.')),       
       BUILD=(%00,C'.',%01)                       
   OUTREC FIELDS=(1,17,SQZ=(SHIFT=LEFT))           
/*                                                 


Output
Code:

SYS3.AACICS     
SYS3.AAVIEW     
SYS3.ABENDAID   
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Oct 16, 2008 2:21 pm
Reply with quote

Quote:
Yes. But you need to answer a few questions.

Yes, and specify whether using SYNCSORT or DFSORT. DFSORT's PARSE function would be very useful for this, I feel.

Garry.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Oct 16, 2008 2:28 pm
Reply with quote

OR Syncsort Release 1.3
Back to top
View user's profile Send private message
harunnisa

New User


Joined: 27 Aug 2008
Posts: 8
Location: Chennai

PostPosted: Thu Oct 16, 2008 3:30 pm
Reply with quote

Hi,
Thanks so much.I need to do this using DFSORT.can u please help me?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Oct 16, 2008 3:38 pm
Reply with quote

harunnisa
wrote:

Thanks so much.I need to do this using DFSORT.can u please help me?

Have you taken effort copying above to your shop and run it?
Back to top
View user's profile Send private message
harunnisa

New User


Joined: 27 Aug 2008
Posts: 8
Location: Chennai

PostPosted: Thu Oct 16, 2008 4:21 pm
Reply with quote

Hi Sambhaji,

ya..it is working fine..thank u very much...
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 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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top