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
 
Retrive some segments

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Sun Jul 20, 2008 7:41 pm    Post subject: Retrive some segments
Reply with quote

Is it possible to Retrive Some segments from a File and to sort a particlar segment?

Code:
Parent1
Child1
Child1
Child1
Child2
Child3
Child2
Child3
Child2
Child4
Child5

Parent2
Child1
Child1
Child1
Child2
Child3
Child2
Child3
Child2
Child5
.
.
.

Output

Parent1
Child1
Child1
Child1
Child2
Child2
Child2

Parent2
Child1
Child1
Child1
Child2
Child2
Child2


Note:Child2 must be in accending order
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: Sun Jul 20, 2008 10:28 pm    Post subject:
Reply with quote

I can get the output you say you want with a DFSORT job that does a simple COPY and INCLUDE like this:

Code:

   OPTION COPY
   INCLUDE COND=(1,6,SS,EQ,C'Parent,Child1,Child2') 


I suspect what you really want to do is more complicated than that and that you can do what you want using the techniques discussed in the "Sort groups of records" and "Include or omit groups of records" Smart DFSORT Tricks at:

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/

If you need more specific help, show an example of your input records and expected output records with actual values that show what you want to do more clearly. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Mon Jul 21, 2008 7:13 am    Post subject: RE:Is it possible to Retrive any particular segments fm a
Reply with quote

Great Frank

Quote:
But is it possible that a particular segment (Child 2) can be obtained in ascending order

Quote:
Let me Give a sample


Code:
P1 50[Parent1]
C1 20[Child1]
C1 30[Child1] 
C1 40[Child1]
C2 60[Child2]
C3 10[Child3]
C2 20[Child2]
C3 90[Child3]
C2 40[Child2]
C4 10[Child4]
C5 10[Child5]

P2 60[Parent1]
C1 10[Child1]
C1 50[Child1] 
C1 70[Child1]
C2 90[Child2]
C3 20[Child3]
C2 80[Child2]
C3 30[Child3]
C2 70[Child2]
C4 40[Child4]
C5 50[Child5]

Output
P1 50[Parent1]
C1 20[Child1]
C1 30[Child1] 
C1 40[Child1]
C2 20[Child2]
C2 40[Child2]
C2 60[Child2]

P2 60[Parent1]
C1 10[Child1]
C1 50[Child1] 
C1 70[Child1]
C2 70[Child2]
C2 80[Child2]
C2 90[Child2]
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: Mon Jul 21, 2008 10:48 pm    Post subject:
Reply with quote

You still haven't given me all the information I need.

What is the RECFM and LRECL of the input file?

Do you want just the Px, C1 and C2 records?

Do you want the C2 records sorted by the second field?

Do you want the C1 fields sorted by the second field, or left in their original order (I can't tell from your example since the C1 records are already in order by the second field)?
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Tue Jul 22, 2008 8:49 am    Post subject: RE:
Reply with quote

Sry Frank ,I was in a hry

Quote:
Let me give you a clear picture

1.RECFM=FB LRECL = 80

2.Yes i need Px,C1,C2 records alone.

3.I need C2 records to be sorted by the second field

4.Regarding C1 ,we dont have to consider about it we just have to get the records which is there in the input (Mostly it 'l be sorted ).

5.Let me give you more app. example


Quote:
Length of the Px second field is 5
Length of the C1 second field is 10
Length of the C2 second field is 11


Code:
P1  1P101
C1  2C10000001
C1  2C10000002
C1  2C10000003
C2  3C200000007
C3  4C300000000
C2  3C200000006
C3  4C300000000
C2  3C200000001

P2  1P201
C1  2C10000004
C1  2C10000005
C1  2C10000006
C2  3C200000050
C3  4C300000000
C2  3C200000040
C3  4C300000000
C2  3C200000030

OUTPUT

P1  1P101
C1  2C10000001
C1  2C10000002
C1  2C10000003
C2  3C200000001
C2  3C200000006
C2  3C200000007


P2  1P201
C1  2C10000004
C1  2C10000005
C1  2C10000006
C2  3C200000030
C2  3C200000040
C2  3C200000050


I need Px and C1 as of it is in the intput and C2 second field must be sorted and the other segments must be filtered as mentioned above.

I think you got me now right?
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: Tue Jul 22, 2008 10:50 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INCLUDE COND=(1,1,CH,EQ,C'P',OR,1,2,SS,EQ,C'C1,C2')
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:11X'00',92:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,1,CH,EQ,C'P'),
                OVERLAY=(92:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(100:SEQNUM,8,ZD,
                         92:92,8,ZD,SUB,100,8,ZD,TO=ZD,LENGTH=8))
  OUTREC IFTHEN=(WHEN=(1,2,CH,EQ,C'C2'),OVERLAY=(81:5,11))
/*
//CTL2CNTL DD *
  OPTION EQUALS
  SORT FIELDS=(92,8,ZD,A,81,11,CH,A)
  OUTREC BUILD=(1,80)
/*
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Wed Jul 23, 2008 3:37 pm    Post subject: RE:
Reply with quote

Thanx Frank, I got the desired output
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 Jul 30, 2008 2:20 am    Post subject:
Reply with quote

Here's an easier way to do this with DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008):

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//OUT DD DD DSN=...  output file (FB/80)
//SYSIN DD *
  OPTION EQUALS
  INCLUDE COND=(1,1,CH,EQ,C'P',OR,1,2,SS,EQ,C'C1,C2')
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:11X'00')),
        IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'P'),PUSH=(92:ID=8)),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'C2'),OVERLAY=(81:5,11))
  SORT FIELDS=(92,8,ZD,A,81,11,CH,A)
/*


For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to define PCB for paired segments ashok_uddaraju IMS DB/DC 4 Tue Jun 14, 2016 11:40 pm
No new posts Root Segments order kris_madras IMS DB/DC 2 Thu Mar 14, 2013 4:12 pm
No new posts Expanding only root segments from len... don.leahy IMS DB/DC 11 Wed Sep 12, 2012 6:00 pm
No new posts how to get count of segments without ... chand123 IMS DB/DC 3 Fri Aug 03, 2012 2:36 am
No new posts How to retrive prior version of a mem... santoshkumarmanilakkoju All Other Mainframe Topics 7 Fri Jul 06, 2012 6:50 pm

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