MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
mf_user Intermediate Joined: 01 Jun 2003 Posts: 372 Topics: 105
Posted: Wed Aug 26, 2009 10:05 am Post subject: Copy header and selective sub-records...
Hi,
My input file comes like this (LRECL=100, RECFM=FB)..
Code:
----+----1----+----2----+----3----+----4----+----5
ABC9 ORDERDETAILS365001
72207HBC002 A0 3009082572A025072207
72207HBC003 A0 3009082572B125072207
72207HBC005 A0 3009082572C225072207
ABC6 ORDERDETAILS365002
72207YBC002 A0 3009082572A025072207
72207YBC001 A0 3009082572B125072207
72207YBC006 A0 3009082572C325072907
72207YBC006 A0 3009082572B225072807
I would like to pull records as shown here: Header records and also the records that have 'B' appearing in 39th position.
Code:
----+----1----+----2----+----3----+----4----+----5
ABC9 ORDERDETAILS365001
72207HBC003 A0 3009082572B125072207
ABC9 ORDERDETAILS365002
72207YBC001 A0 3009082572B125072207
72207YBC006 A0 3009082572B225072807
Please help.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Aug 26, 2009 10:20 am Post subject:
mf_user,
The following DFSORT JCL will give you the desired results
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your 100 byte Fb file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'ABC'),PUSH=(101:1,100))
OUTFIL INCLUDE=(39,1,CH,EQ,C'B'),REMOVECC,BUILD=(1,100),
SECTIONS=(101,100,HEADER3=(101,100))
/*
_________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
mf_user Intermediate Joined: 01 Jun 2003 Posts: 372 Topics: 105
Posted: Wed Aug 26, 2009 11:24 am Post subject:
Kolusu, I will try it and come back... Thx. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
mf_user Intermediate Joined: 01 Jun 2003 Posts: 372 Topics: 105
Posted: Fri Aug 28, 2009 4:58 am Post subject:
Thanks a lot Kolusu. I have got my results. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
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