Академический Документы
Профессиональный Документы
Культура Документы
extract data from the tape file (file record length-387) with condition that "whenever
chars B8 is found at 68th position,only those records needs to be extracted.
Assuming your input tape file has RECFM=FB, you can use a DFSORT job like the
following to do what you asked for (there's nothing special about using a tape file as
input other than specifying the correct JCL parameters):
Code:
---------------------------------
DFSORT is an IBM product. DFSORT includes ICETOOL. The messages for IBM
products are easily accessible. The easiest way to look up an IBM message is to use
IBM's LookAt facility at:
http://www.ibm.com/servers/eserver/zseries/zos/bkserv/lookat/
You just choose the version of z/OS you want, e.g. V1R12, type the message into the
message ID box (for example, ICE077A), hit enter and the message text is displayed.
The other easy way to look up DFSORT messages is in "z/OS DFSORT Messages,
Codes and Diagnosis Guide" which you can access along with all the other DFSORT
books from:
http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Click on "Messages and Codes", then "Informational and Error Messages" and you'll get
a clickable list of the DFSORT messages. Here's the direct link:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CM20/2.2?
SHELF=&DT=20060721170811&CASE=
---------------------------------------
3. Many z/OS DFSORT functions were delivered as PTFs at various times, so in order to
use them your System Programmer needs to have installed a specific DFSORT PTF. To
read all about the DFSORT functions delivered in October, 2010, November, 2009, July,
2008, April, 2006 and Dec, 2004, see:
http://ibmmainframes.com/viewtopic.php?t=1348
Note: z/OS DFSORT V1R10 is used for z/OS 1.10-1.11. z/OS DFSORT V1R12 is used
for z/OS 1.12. These are the only currently supported releases of DFSORT.
To determine which level of DFSORT functions you have available, look at message
ICE201I in the //SYSOUT messages you receive from the DFSORT job shown below, or
from any successful DFSORT job.
If you see:
the H indicates you have the October, 2010 DFSORT functions (RESIZE, IFTRAIL,
ACCEPT, ADDDAYS, DATEDIFF, TRAN=ATOE, KEYBEGIN, etc) and all of the
earlier functions. This function level corresponds to z/OS DFSORT V1R10 PTF
UK90025 and z/OS DFSORT V1R12 PTF UK90026. You are completely up to date on
DFSORT functional PTFs.
Note: If you see WERxxxs messages, you have Syncsort, not DFSORT.
If you see:
the G indicates you have the November, 2009 DFSORT functions (JOINKEYS, TOJUL,
TOGREG, WEEKDAY, etc) and all of the earlier functions. This function level
corresponds to z/OS DFSORT V1R5 PTF UK51706 and z/OS DFSORT V1R10 PTF
UK51707. You are behind on DFSORT functional PTFs. Ask your System Programmer
to install z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF
UK90026.
If you see:
the F indicates you have the July, 2008 DFSORT functions (FINDREP,
WHEN=GROUP, DATASORT, SUBSET, etc) and all of the earlier functions.
This function level corresponds to z/OS DFSORT V1R5 PTF UK90013 and z/OS
DFSORT V1R10 PTF UK90014. You are behind on DFSORT functional PTFs. Ask
your System Programmer to install z/OS DFSORT V1R10 PTF UK90025 or z/OS
DFSORT V1R12 PTF UK90026.
If you see:
the E indicates you have the April, 2006 DFSORT functions (PARSE, JFY, SQZ,
SPLIT1R, etc) and all of the earlier functions. This function level corresponds to z/OS
DFSORT V1R5 PTF UK90007. You are behind on DFSORT functional PTFs. Ask your
System Programmer to install z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT
V1R12 PTF UK90026.
If you see:
the 0 indicates you do not have the July, 2008 or April, 2006 DFSORT functions. You
are way behind on DFSORT functional PTFs. Ask your System Programmer to install
z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026.
You may or may not have the Dec, 2004 DFSORT functions (IFTHEN, OVERLAY,
SFF, UFF, etc), which corresponds to z/OS DFSORT V1R5 PTF UQ95214. try using one
of these functions - if you get errors trying to use it, then you don't even have the Dec,
2004 PTF installed.
*******************
Code:
File1 has a field that that has to be added to file2 where the keys match and a default
value where they do not match.
here is my JCL
Now I want to know which all records are missing in file-2, when compare to file-1.
File-1
Code:
01
02
03
04
05
06
File-2
Code:
01
03
05
Code:
Alternatively, assuming the two input files have the same RECFM and LRECL, you can
use a DFSORT/ICETOOL job like the following:
Code:
-----------------------
5.
I have an input file having one or more fee
amounts charged to a customer. For each
record, I need to sum all the fee amounts of
'SALE' and 'MGMT' type and generate the
result in single column in output file.
Code:
A014SALE====MGMT====SALE====SAL
E====
B014MGMT====SALE====MGMT====MG
MT====
C015ADMN====MGMT====SALE====INS
U====SALE====
D012ADMN====SALE====
E013MGMT====ADMN====SALE====
Expected output:
Code:
A01====
B01====
C01====
D01====
E01====
Anyway we can do it through
DFSORT/ICEMAN/ICETOOL?
A01====
A01====
A01====
A01====
B01====
B01====
B01====
B01====
C01====
C01====
C01====
D01====
E01====
E01====
--- Andy
Back to top
References<>
Frank Yaeger
DFSORT Moderator
What is the RECFM of the input file? It's difficult to tell whether this is really a VB file, or an
FB file padded with blanks. Which is it?
Quote:
Amount-- from position 9 to 12 (Format: Signed packed decimal i.e. S9(9)V9(2) COMP-3) -
Indicates the amount for that description
An S(9)V9(2) COMP-3 field would be 6 bytes. But you say the amount is in positions 9-12
which is only 4 bytes. Which is correct?
Quote:
within an OCCURS claues that can go max upto 10 times based on value present in field
"COUNT"
What type of number? You can't use a ZD or PD value to get 10 into one byte, so what kind of
number is it?
Back to top
Andy85
New User
You can consider the maximum occurences as 9 and the COUNT field as of type ZD with length
of 1 character.
Back to top
Frank Yaeger
DFSORT Moderator
And what about my other two questions about RECFM, and 4-bytes vs 6-bytes for the PD field?
Back to top
devil13
New User
Hi Andy85,
You can modify the below JCL and use it for your requirement:
Code:
//SORTIN DD *
A014SALE2000MGMT2000SALE2000SALE2000
B014MGMT1000SALE1000MGMT1000MGMT1000
C015ADMN1000MGMT1000SALE1000INSU1000SALE1000
D012ADMN9999SALE9999
E013MGMT9000ADMN9000SALE9000SALE9000
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(4,1,ZD,EQ,2),
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,20:X)),
IFTHEN=(WHEN=(4,1,ZD,EQ,3),
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,ADD,25,4,ZD,20:X)),
IFTHEN=(WHEN=(4,1,ZD,EQ,4),
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,ADD,25,4,ZD,
ADD,33,4,ZD)),
IFTHEN=(WHEN=(4,1,ZD,EQ,5),
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,ADD,25,4,ZD,
ADD,33,4,ZD,ADD,41,4,ZD)),
IFTHEN=(WHEN=(4,1,ZD,EQ,6),
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,ADD,25,4,ZD,
ADD,33,4,ZD,ADD,41,4,ZD,ADD,49,4,ZD)),
IFTHEN=(WHEN=(4,1,ZD,EQ,7),
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,ADD,25,4,ZD,
ADD,33,4,ZD,ADD,41,4,ZD,ADD,49,4,ZD,
ADD,57,4,ZD)),
IFTHEN=(WHEN=(4,1,ZD,EQ,8),
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,ADD,25,4,ZD,
ADD,33,4,ZD,ADD,41,4,ZD,ADD,49,4,ZD,
ADD,57,4,ZD,ADD,65,4,ZD)),
IFTHEN=(WHEN=(4,1,ZD,EQ,9),
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,ADD,25,4,ZD,
ADD,33,4,ZD,ADD,41,4,ZD,ADD,49,4,ZD,
ADD,57,4,ZD,ADD,65,4,ZD,ADD,73,4,ZD))
//*
devil13
There is always a better solution.
Back to top
vasanthz
Active User
@devil13
Quote:
BUILD=(1,3,9,4,ZD,ADD,17,4,ZD,20:X)),
Hi,
User wants to add comp3 values. so ZD should be changed to something else right?
Back to top
devil13
New User
Joined: 18 Jul 2010
Posts: 40
Location: chennai
Posted: Mon Feb 07, 2011 2:12 pm Post subject:
Hi Vasanthz,
You are right.
Actually Frank had raised the questions regarding the size of the variables:
Quote:
An S(9)V9(2) COMP-3 field would be 6 bytes. But you say the amount is in positions 9-12
which is only 4 bytes. Which is correct?
So the user can make changes in the sort card according to the data he has in the input.
devil13
There is always a better solution
Back to top
Andy85
New User
Quote:
An S(9)V9(2) COMP-3 field would be 6 bytes. But you say the amount is in positions 9-12
which is only 4 bytes. Which is correct?
Frank,
The field picture clause is S9(9)V9(2).So the amount position would be of 6 bytes. You are
correct. Incorrectly mentioned it as 4-bytes in my examples.
Back to top
Andy85
New User
devil13,
The parameters/job you have mentioned sums up all the amounts in the same row. However, my
requirement is to sum up only those amounts for SALE & MGMT. There is no such condition in
the SORTIN that you have provided. Is there any way of adding this condition too?
Back to top
Frank Yaeger
DFSORT Moderator
Assuming that the PD values are 6 bytes each, and the RECFM is FB, you can use a DFSORT
job like the following to do what you asked for. The result will have the customer number
followed by the 6 byte PD totals for SALE and MGMT.
Code:
Back to top
devil13
New User
Joined: 18 Jul 2010
Posts: 40
Location: chennai
Posted: Tue Feb 08, 2011 9:13 am Post subject:
Hi Andy85,
You have the solution now.
Quote:
Or atleast If I could get below output, which is one record for each fee amount for same
customer:
Code:
A01====
A01====
A01====
A01====
B01====
B01====
B01====
B01====
C01====
C01====
C01====
D01====
E01====
E01====
The below JCL is just to meet the above requirement. Thought this would also be helpful for
someone like me in future
Code:
//SORTIN DD *
A014SALE2000MGMT2000SALE2000SALE2000
B014MGMT1000SALE1000MGMT1000MGMT1000
C015ADMN1000MGMT1000SALE1000INSU1000SALE1000
D012ADMN9999SALE9999
E013MGMT9000ADMN9000SALE9000
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=(4,1,ZD,EQ,2),
BUILD=(1,3,5,8,/,
1,3,13,8)),
IFTHEN=(WHEN=(4,1,ZD,EQ,3),
BUILD=(1,3,5,8,/,
1,3,13,8,/,
1,3,21,8)),
IFTHEN=(WHEN=(4,1,ZD,EQ,4),
BUILD=(1,3,5,8,/,
1,3,13,8,/,
1,3,21,8,/,
1,3,29,8)),
IFTHEN=(WHEN=(4,1,ZD,EQ,5),
BUILD=(1,3,5,8,/,
1,3,13,8,/,
1,3,21,8,/,
1,3,29,8,/,
1,3,37,8)),
IFTHEN=(WHEN=(4,1,ZD,EQ,6),
BUILD=(1,3,5,8,/,
1,3,13,8,/,
1,3,21,8,/,
1,3,29,8,/,
1,3,37,8,/,
1,3,45,8)),
IFTHEN=(WHEN=(4,1,ZD,EQ,7),
BUILD=(1,3,5,8,/,
1,3,13,8,/,
1,3,21,8,/,
1,3,29,8,/,
1,3,37,8,/,
1,3,45,8,/,
1,3,53,8)),
IFTHEN=(WHEN=(4,1,ZD,EQ,8),
BUILD=(1,3,5,8,/,
1,3,13,8,/,
1,3,21,8,/,
1,3,29,8,/,
1,3,37,8,/,
1,3,45,8,/,
1,3,53,8,/,
1,3,61,8)),
IFTHEN=(WHEN=(4,1,ZD,EQ,9),
BUILD=(1,3,5,8,/,
1,3,13,8,/,
1,3,21,8,/,
1,3,29,8,/,
1,3,37,8,/,
1,3,45,8,/,
1,3,53,8,/,
1,3,61,8,/,
1,3,69,8)),
//*
A01SALE2000
A01MGMT2000
A01SALE2000
A01SALE2000
B01MGMT1000
B01SALE1000
B01MGMT1000
B01MGMT1000
C01ADMN1000
C01MGMT1000
C01SALE1000
C01INSU1000
C01SALE1000
D01ADMN9999
D01SALE9999
E01MGMT9000
E01ADMN9000
E01SALE9000
devil13
There is always a better solution.
Back to top
Skolusu
DFSORT Developer
devil13 wrote:
The below JCL is just to meet the above requirement. Thought this would also be helpful for
someone like me in future.
devil13,
With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026
(Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to easily create
smaller records from larger records or larger records from smaller records.
Code: