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
 
Extract records with data from prev. record

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

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Thu Jun 04, 2009 3:14 pm    Post subject: Extract records with data from prev. record
Reply with quote

Hi folks,

is it possible to extract records to an output file together with data from a previous record ?

Example (input file) :

ROOT 7777 Data
CHILDA XX 1 Data
CHILDA XX 2 Data
CHILDB Data
ROOT 4444 Data
CHILDB Data
ROOT 2222 Data
ROOT 9999 Data
CHILDA XX 1 Data

Now, I'm looking for all CHILDA records containing 'XX' on pos. 8 and the whole data of their root.

Result (output file) :

CHILDA XX 1 Data ROOT 7777 Data
CHILDA XX 2 Data ROOT 7777 Data
CHILDA XX 1 Data ROOT 9999 Data

Any ideas...?
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 Jun 04, 2009 9:08 pm    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
ROOT    7777 Data
CHILDA XX 1 Data
CHILDA XX 2 Data
CHILDB Data
ROOT    4444 Data
CHILDB Data
ROOT    2222 Data
ROOT    9999 Data
CHILDA XX 1 Data
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'ROOT'),
    PUSH=(18:1,20))
  OUTFIL INCLUDE=(1,9,CH,EQ,C'CHILDA XX')
/*
Back to top
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Tue Jun 09, 2009 3:20 pm    Post subject:
Reply with quote

Hi Frank,

many thanks for your help, your solution works very well !! icon_smile.gif

Is there an Application Programming Guide available (pdf), where the GRUOP and the push option is described ?
I have only an old Guide...

Many thanks
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jun 09, 2009 8:56 pm    Post subject:
Reply with quote

oerdgie wrote:
Hi Frank,

many thanks for your help, your solution works very well !! icon_smile.gif

Is there an Application Programming Guide available (pdf), where the GRUOP and the push option is described ?
I have only an old Guide...

Many thanks


Check this link which explain in detail about the group and many other new functions

http://www-947.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Wed Jun 10, 2009 3:06 am    Post subject:
Reply with quote

Many thanks ! icon_biggrin.gif
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 select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am
No new posts Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm

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