View previous topic :: View next topic
|
Author |
Message |
raghavendra_p_sarvade
New User
Joined: 17 Oct 2006 Posts: 32
|
|
|
|
Hi,
I want to get the number of records from one file and move that value into a field in another file (with a different layout).
Will it be possible to do it thru JCL?
Thanks - Raghav |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
rag,
Quote: |
Will it be possible to do it thru JCL?
|
Yes, it is possible. Search the DFSORT forum for "COUNT". |
|
Back to top |
|
|
raghavendra_p_sarvade
New User
Joined: 17 Oct 2006 Posts: 32
|
|
|
|
Thans Aaru.
I could see COUNT options which just writes out a file with just record count in that.
But I have to not just take the record count, but populate that into another file (which has a different layout) with data.
Can you help?
Thanks - Raghav |
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
You mean to copy the data as well as the record count |
|
Back to top |
|
|
raghavendra_p_sarvade
New User
Joined: 17 Oct 2006 Posts: 32
|
|
|
|
hi..
I dont need to copy the records from the file. I just need to get the record count.
That record count has to go into another file with a different layout and data.
Thanks - Raghav |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can create a DFSORT Symbol with the count of records and use the Symbol for a field in another file. Here's an example:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create a DFSORT symbol as follows:
* CT,'dddddddd'
* where dddddddd is the count of records in the input file.
OUTFIL REMOVECC,NODETAIL,
BUILD=(80X),
TRAILER1=('CT,''',COUNT=(M11,LENGTH=8),'''')
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file2
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
* Use the CT symbol for the count.
INREC OVERLAY=(11:CT)
/*
|
|
|
Back to top |
|
|
|