Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: To get the record count of a file in further steps in a job
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 Moderator


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

PostPosted: Sat Dec 24, 2005 9:56 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Dec 26, 2005 10:06 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Dec 27, 2005 8:29 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Dec 28, 2005 8:13 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us