MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

previous two after two

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Wed May 12, 2010 10:54 pm    Post subject: previous two after two Reply with quote

Hi,

My Input File (LRECL=600, RECFM=FB) is as shown below. The records come in a set of four and appear continous but not tied with any identifier to recognize it as a set.

Code:

## Header@@@ Steve
## B01 C01 H01 D01 ............... F01 Z01 K01@@@ @@@ @
##                         Liffanchyatmi Kodubuoy@exvif
## FEB 10 sles chewm fori froy mintolibjjjj B01 C01 D01

## HeadS $$
## T01 D01 K01 F01 ............... C01 P01 K01.........
##             Liffanchyatmi Kodubuoy@exvif
## MAR 10 sles ssewm kjri tboy jumillibjjjj T01 D01 K01

## Hea@dP &&&
## F01 S01 O01 G01 ............... J01 R01 A01.........
##             froyntti gracias
## APR 11 sages folyi kj2i ttoy laholkalldi F01 S01 O01

## H#eadS $$@
## V01 W01 M01 C01 ............... X01 L01 Q01......M..
##                             @@ %(&                          Liffanchyatmi Kodubuoy@exvif
## JAN 12 alex maci fiz friz guloptoninoski V01 W01 M01


My requirement is to copy only those set of records that have "Kodubuoy@exvif" appearing somewhere in 3rd row in a set of records.

Expected Output:

Code:

## Header@@@ Steve
## B01 C01 H01 D01 ............... F01 Z01 K01@@@ @@@ @
##                         Liffanchyatmi Kodubuoy@exvif
## FEB 10 sles chewm fori froy mintolibjjjj B01 C01 D01

## HeadS $$
## T01 D01 K01 F01 ............... C01 P01 K01.........
##             Liffanchyatmi Kodubuoy@exvif
## MAR 10 sles ssewm kjri tboy jumillibjjjj T01 D01 K01

## H#eadS $$@
## V01 W01 M01 C01 ............... X01 L01 Q01......M..
##                             @@ %(&                          Liffanchyatmi Kodubuoy@exvif
## JAN 12 alex maci fiz friz guloptoninoski V01 W01 M01


Please help.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu May 13, 2010 12:03 am    Post subject: Reply with quote

mf_user,

Untested control cards

Code:

//SYSIN DD *
  INREC IFTHEN=(WHEN=GROUP,RECORDS=4,PUSH=(601:ID=8,SEQ=1)),
  IFTHEN=(WHEN=(1,600,SS,EQ,C'Kodubuoy@exvif'),OVERLAY=(610:C'P'))
  SORT FIELDS=(601,8,CH,A,610,1,CH,D),EQUALS
  OUTREC IFTHEN=(WHEN=GROUP,RECORDS=4,BEGIN=(610,1,CH,EQ,C'P'),
  PUSH=(610:610,1,1,600))
  OUTFIL IFOUTLEN=600,
  INCLUDE=(610,1,CH,EQ,C'P',AND,609,1,ZD,NE,3),
  IFTHEN=(609,1,ZD,EQ,4),BUILD=(611,610,/,1,600))
//*
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Thu May 13, 2010 8:54 am    Post subject: Thanks Reply with quote

Hi,

I got the results after making some changes to the SYSIN.

Code:

//SYSIN DD *
  INREC IFTHEN=(WHEN=GROUP,RECORDS=4,PUSH=(601:ID=8,SEQ=1)),
  IFTHEN=(WHEN=(1,600,SS,EQ,C'Kodubuoy@exvif'),OVERLAY=(610:C'P'))
  SORT FIELDS=(601,8,CH,A,610,1,CH,D),EQUALS
  OUTREC IFTHEN=(WHEN=GROUP,RECORDS=4,BEGIN=(610,1,CH,EQ,C'P'),
  PUSH=(610:610,1,1,600))
  OUTFIL IFOUTLEN=600,
  INCLUDE=(610,1,CH,EQ,C'P',AND,609,1,ZD,NE,3),
  IFTHEN=(WHEN=(609,1,ZD,EQ,4),BUILD=(611,600,/,1,600))
//*


Thanks a lot for your wonderful piece of code. Smile
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu May 13, 2010 10:24 am    Post subject: Reply with quote

mf_user,

Oops the last IFTHEN was missing a WHEN and the length should be 600 instead of 610. bonk Glad you got it right.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group