IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To get the record count of a file in further steps in a job


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Sat Dec 24, 2005 3:45 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Dec 24, 2005 9:56 pm
Reply with quote

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
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Mon Dec 26, 2005 1:34 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Dec 26, 2005 10:06 pm
Reply with quote

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
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Tue Dec 27, 2005 1:55 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 27, 2005 8:29 pm
Reply with quote

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
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Wed Dec 28, 2005 12:37 pm
Reply with quote

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
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Wed Dec 28, 2005 2:32 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Dec 28, 2005 8:13 pm
Reply with quote

Here's an easier way:

Code:

   OPTION COPY                                                 
   OUTFIL REMOVECC,NODETAIL,                                   
     OUTREC=(80X),                                             
     TRAILER1=(' OPTION COPY,STOPAFT=',COUNT=(M11,LENGTH=10))   
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top