|
View previous topic :: View next topic
|
| Author |
Message |
jerryte
Active User

Joined: 29 Oct 2010 Posts: 205 Location: Toronto, ON, Canada
|
|
|
|
The below idea would make it easy to edit and maintain ICETOOL and SORT control statements within the same member. It also makes the code more self documenting since the two parts are together. Let me know what you think of this idea. If people like this idea then I could try and submit it to IBM directly. Not sure if they would listen.
New ICETOOL statement PARMDATA would allow the inclusion of SORT control cards within the same member that has the ICETOOL statements. These could then be used in subsequent statements.
Syntax:
PARMDATA USING(????) EOD('?') SYMBOL
USING(????) defines a dd name ????CNTL where the lines are written to. If the dd does not exist then it will be dynamically allocated as FB80
EOD(?) defines string of 1 to 40 characters to mark the end of data. When it is used the end-of-data string must begin in column 1.
SYMBOL (optional) defines that symbolic substitution will occur before the line is written. The default is no substitution - data is written as is.
Function:
All lines following the PARMDATA up to but not include the end-of-data marker are then written to the temporary dataset as FB 80. If the DD is not present then the dataset will be dynamically allocated. Subsequent ICETOOL statements can then refer to this dataset via the USING(????) parm.
Example:
The below will perform an icetool DATASORT
| Code: |
PARMDATA USING(SORT) EOD('<END-OF-DATA>')
INCLUDE COND=(20,2,CH,NE,C' ')
SORT FIELDS=(1,10,CH,A)
<END-OF-DATA>
DATASORT FROM(ICEIN) TO(ICEOUT) USING(SORT)
|
|
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
jerryte,
DFSORT already have DFSPARM which can override the control cards and apply the overrides globally and perform the task you want. The only exception to using DFSPARM is that the control cards needs to start in position 2.
for ex:
| Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//DFSPARM DD *
INCLUDE COND=(20,2,CH,NE,C' ')
SORT FIELDS=(1,10,CH,A)
//IN DD *
----+----1----+----2----+----3----+----4
2222222222 AA
1111111111 BB
4444444444 CC
0000000000 DD
9999999999
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) TO(OUT1) USING(SORT)
SORT FROM(IN) TO(OUT2) USING(BLAH)
//SORTCNTL DD *
//BLAHCNTL DD *
//* |
The output from the both sorts is
| Code: |
0000000000 DD
1111111111 BB
2222222222 AA
4444444444 CC
|
Well you can even invoke Joinkeys using ICEGENER Via DFSPARM
| Code: |
//STEP0100 EXEC PGM=ICEGENER
//SYSPRINT DD SYSOUT=*
//INP1 DD *
Z
D
A
C
//INP2 DD *
C MATCH VALUE2
A MATCH VALUE1
//SYSUT2 DD SYSOUT=*
//DFSPARM DD *
JOINKEYS F1=INP1,FIELDS=(1,1,A)
JOINKEYS F2=INP2,FIELDS=(1,1,A)
REFORMAT FIELDS=(F1:1,3,F2:4,15)
//SYSIN DD DUMMY
//* |
|
|
| Back to top |
|
 |
jerryte
Active User

Joined: 29 Oct 2010 Posts: 205 Location: Toronto, ON, Canada
|
|
|
|
Thanks for the tip. I had thought that DFSPARM was meant for sort OPTIONS only. Putting sort control statements on this dd seems like a trick that might fool the unsuspecting reader. It still puts statements into 2 or possibly 3 different places (DFSPARM, SYSIN, TOOLIN).
The point of my suggestion was to allow all statements to be in one location usually a pds member. If ICETOOL is run inside a JCL proc then instream dd is not allowed. This requires 2 or more pds parmlib members to be used. With my suggestion the ICETOOL statements and the SORT control statements can be in one pds member. Easier to read and analyze. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|