View previous topic :: View next topic
|
Author |
Message |
Musab Razeen Ahmed
New User
Joined: 24 Feb 2011 Posts: 16 Location: India
|
|
|
|
Hello All,
I have a situation as follows. There is a dataset which has a header and then a number of records as shown below
00000173822615/05/201100239MSAPOSCIS------>header
0100105299301047587655 T09 02266879
0100105299301047587655 T73 01057102
0100101005108244016212 T62 04275268
0100101005103040471844 T35 02201764
A string of 5 zeroes indicates it is a header. Now i need to browse this file and take a count of all the records it contains(including header), and then i need to update columns 6 - 12 with this number. For example, if the above file contains 1999888 records, the header should look as
00000199988815/05/201100239MSAPOSCIS------>header
0100105299301047587655 T09 02266879
0100105299301047587655 T73 01057102
0100101005108244016212 T62 04275268
0100101005103040471844 T35 02201764
Thanks,
Musab |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Below steps will give you desired output...
Code: |
//S1 EXEC PGM=SORT
//SORTIN DD *
00000XXXXXXX15/05/201100239MSAPOSCIS------>HEADER
0100105299301047587655 T09 02266879
0100105299301047587655 T73 01057102
0100101005108244016212 T62 04275268
0100101005103040471844 T35 02201764
//SORTOUT DD DSN=&&TEMP,DISP=(NEW,PASS)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=7),'''',80:X)
/*
//S2 EXEC PGM=SORT
//SORTIN DD *
00000XXXXXXX15/05/201100239MSAPOSCIS------>HEADER
0100105299301047587655 T09 02266879
0100105299301047587655 T73 01057102
0100101005108244016212 T62 04275268
0100101005103040471844 T35 02201764
//SORTOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&TEMP,DISP=(OLD,DELETE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,5,CH,EQ,C'00000'),
OVERLAY=(6:FCOUNT))
/*
|
Output will be
Code: |
00000000000515/05/201100239MSAPOSCIS------>HEADER
0100105299301047587655 T09 02266879
0100105299301047587655 T73 01057102
0100101005108244016212 T62 04275268
0100101005103040471844 T35 02201764 |
|
|
Back to top |
|
|
Musab Razeen Ahmed
New User
Joined: 24 Feb 2011 Posts: 16 Location: India
|
|
|
|
Colud you please explain me the following line, B'coz i could not understand it? ( or you can specify a link wer i can i can get some info on it )
TRAILER1=(C'FCOUNT',C',''',COUNT=(M11,LENGTH=7),'''',80:X)
Regards
Musab |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Musab Razeen Ahmed,
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:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
Musab Razeen Ahmed
New User
Joined: 24 Feb 2011 Posts: 16 Location: India
|
|
|
|
Thanks All for your prompt replies.
The links and materials mentioned were quite useful.
Regards,
Musab |
|
Back to top |
|
|
|