View previous topic :: View next topic
|
Author |
Message |
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
I have a requirement where in i have to pass the record count of a input file in one step to ENDREC parameter of another job step.
Like
step1
count from(file1) ---- store this in some symbolic parameter
step2
copy from(abc),startrec=z,endrec=¶meter
Regards, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
copy from(abc),startrec=z,endrec=?meter |
What product are you trying to use? DFSORT has STARTREC and ENDREC parameters (in OUTFIL), and DFSORT's ICETOOL has a COPY operator, but what you show isn't DFSORT or ICETOOL syntax. Are you trying to use DFSORT? |
|
Back to top |
|
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
Yeah i was trying to use DFSORT only.
The requirement is like i have to get the count of a file in one Step
of a job and later use that count in the next step to extract that many
records into a file.
Regards, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can't use a DFSORT symbol for SKIPREC, STOPAFT, STARTREC or ENDREC. If you want to get a count of records for a file and use it to extract records, you would have to generate a control statement to do that and use that control statement in the second step.
If you show me exactly what you're trying to do, I can show you how to do it. Are we talking about one file for the count and another file for the extract or the same file or what? Which records are you trying to extract (e.g., 1 to 20, 25 to 50, ?)? |
|
Back to top |
|
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
The exact requirement is like this.
I have a file file01 used in job.
file01 creates file03 in some program. Now using the count of file03 i
have to extract that many number of records into file04 from some other file02.
file01 to file03 some records
file02 to file04 with equal record count in file03.
Ultimately i should be having same record count to file04 and file04
Regards, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
That really doesn't tell us which records you're trying to extract from file02. If file03 has a count of n, do you want to extract the first n records from file02, or some other set of records (what set?)? It would help if you'd show an example of the records in each input and output file. Also, what is the RECFM and LRECL of each input file? |
|
Back to top |
|
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
i am trying to extract first n records from the file02 to file04
All the files are of LRECL=80 and RECFM=F
ex:
file01
aaaaaaaaaa
bbbbbbbbbb
ccccccccccccc
dddddddddd
file03
aaaaaaaaaa
bbbbbbbbbb
file02
xxxxxxxxxx
yyyyyyyyyy
zzzzzzzzzz
file04
Now for file04 i need to extract only
xxxxxxxxxx
yyyyyyyyyy from file02 based on the record count from file03 ie 2.
The records for the file03 are getting populated to file03 through a program, so its the count of the file03 that is required for me to extract
that many records into file04.
pls let me know if am not clear.
Regards, |
|
Back to top |
|
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
I got a solution to my problem.
I searched the forum and got a query where someone needed to
copy first and last records.
Using that I created control card with record count in file03 into the
control card
Code: |
//SYSIN DD *
OPTION SKIPREC=1
SORT FIELDS=COPY
OUTREC FIELDS=(SEQNUM,10,ZD,START=2,INCR=1,80:X)
OUTFIL NODETAIL,REMOVECC,
TRAILER1=(C' OUTFIL FNAMES=OUT1,STARTREC=1,ENDREC=',1,10,80:X)
/*
|
and use this in my icetool control card for file04 copy.
Thanks for all your support.
Regards, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's an easier way:
Code: |
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
OUTREC=(80X),
TRAILER1=(' OPTION COPY,STOPAFT=',COUNT=(M11,LENGTH=10))
|
|
|
Back to top |
|
|
|