View previous topic :: View next topic
|
Author |
Message |
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
I have an input file like this
VICE LEVEL SUMMARY REPORT 12/16/08 PAGE 1
WHSE UNITS WHSE PURCH UNITS
73 43.19 29813
0 0.00 591
In this
VICE LEVEL SUMMARY REPORT 12/16/08
is the header which has a date 12/16/08 at position say 60
I need to create an output file with the date as a sperate field like
WHSE UNITS WHSE PURCH UNITS DATE
73 43.19 29813 12/16/08
0 0.00 591 12/16/08
ie, to take the header date from input file and place it as a seperate field in output file using DFSORT |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Prasanth,
Quote: |
e, to take the header date from input file and place it as a seperate field in output file using DFSORT
|
This can be done using SYMNAMES. Search the forum for working examples. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Prasanth,
I had a similar reqt before and was lucky enough to get the solution. Check the below link, try and post if you face any problems.
SYMNAMES |
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
Thanks Aaru |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
prasanthhere,
You can very easily push the value on the header records on to the detail records using the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
VICE LEVEL SUMMARY REPORT 12/16/08 PAGE 1
WHSE UNITS WHSE PURCH UNITS
73 43.19 29813
0 0.00 591
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(12,14,CH,EQ,C'SUMMARY REPORT'),
PUSH=(30:27,8))
OUTFIL OMIT=(12,14,CH,EQ,C'SUMMARY REPORT')
//*
|
The output from this job is
Code: |
WHSE UNITS WHSE PURCH UNITS 12/16/08
73 43.19 29813 12/16/08
0 0.00 591 12/16/08
|
If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).
For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Hi Kolusu,
That was a great solution. DFSORT team Rocks |
|
Back to top |
|
|
|