View previous topic :: View next topic
Author
Message
teethu thomas New User Joined: 17 May 2007Posts: 24 Location: India
Hi all,
My requirement is like
Input file
********first-type**********
aaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaa
********Second-type*******
bbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbb
********Third-type**********
cccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccc
********End of Input file****
Outfile1-
aaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaa
Outfile2 -
bbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbb
Outfile3 -
cccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccc
Is it possible to do . can somebody help me with this
Back to top
teethu thomas New User Joined: 17 May 2007Posts: 24 Location: India
Input file is of size 133
Output files are also of size 133
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
It's not clear what you're trying to do. Are the header records
********first-type**********
etc actually in the file and do you want to divide the records according to those header records?
Or are the headers records really not in the file and do you want to divide the records by something in the records? If so, what?
Please explain more clearly what you want to do.
And why does your Subject say you want 4 files whereas your example only shows 3 files?
Back to top
teethu thomas New User Joined: 17 May 2007Posts: 24 Location: India
Ya the header records are there in the file . i want to divide the records based on the header records
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Will there always and only be 3 headers?
What should happen if 17 headers are present in a single run?
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
teethu,
You can use a DFSORT/ICETOOL job like this:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/133)
//OUT1 DD DSN=... output file1 (FB/133)
//OUT2 DD DSN=... output file2 (FB/133)
//OUT3 DD DSN=... output file3 (FB/133)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,5,CH,EQ,C'*****'),
OVERLAY=(134:SEQNUM,8,ZD)),
IFTHEN=(WHEN=NONE,
OVERLAY=(142:SEQNUM,8,ZD,
134:134,8,ZD,SUB,142,8,ZD,M11,LENGTH=8))
OUTFIL FNAMES=OUT1,
INCLUDE=(134,8,ZD,EQ,+1,AND,1,5,CH,NE,C'*****'),
BUILD=(1,133)
OUTFIL FNAMES=OUT2,
INCLUDE=(134,8,ZD,EQ,+2,AND,1,5,CH,NE,C'*****'),
BUILD=(1,133)
OUTFIL FNAMES=OUT3,
INCLUDE=(134,8,ZD,EQ,+3,AND,1,5,CH,NE,C'*****'),
BUILD=(1,133)
/*
Back to top
teethu thomas New User Joined: 17 May 2007Posts: 24 Location: India
Can you explain me the meaning of these statement
Code:
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,5,CH,EQ,C'*****'),
OVERLAY=(134:SEQNUM,8,ZD)),
IFTHEN=(WHEN=NONE,
OVERLAY=(142:SEQNUM,8,ZD,
134:134,8,ZD,SUB,142,8,ZD,M11,LENGTH=8))
OUTFIL FNAMES=OUT1,
INCLUDE=(134,8,ZD,EQ,+1,AND,1,5,CH,NE,C'*****'),
BUILD=(1,133)
OUTFIL FNAMES=OUT2,
INCLUDE=(134,8,ZD,EQ,+2,AND,1,5,CH,NE,C'*****'),
BUILD=(1,133)
OUTFIL FNAMES=OUT3,
INCLUDE=(134,8,ZD,EQ,+3,AND,1,5,CH,NE,C'*****'),
BUILD=(1,133)
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
The INREC IFTHEN statements are the "group" trick explained in the "Include or omit groups of records" and "Sort groups of records" Smart DFSORT Tricks at:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
They assign a group number to each group of records that starts with '*****' (your type headers).
The first OUTFIL statement writes the records from group 1 (except for the header) in OUT1.
The second OUTFIL statement writes the records from group 2 (except for the header) in OUT2.
The third OUTFIL statement writes the records from group 3 (except for the header) in OUT3.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links
Back to top
Please enable JavaScript!