View previous topic :: View next topic
Author
Message
arunmozhicholan New User Joined: 07 Feb 2007Posts: 27 Location: chennai
Hi ,
i need some help to get the following o/p files like below .
input file:
*********
Code:
abc01 swaminathan 20012008 5434324567 pqrsxxx01
abc02 krishnamurthy 10102007 5533445687 pqrsxxx02
abc03 sankarnathan 10022004 6123123409 pqrsxxx03
abc04 mohandasam 07082003 6213765434 pqrsxxx04
abc05 suresh kumar 05102008 5956129876 pqrsxxx05
abc06 sayed kumar 04112008 6023876563 pqrsxxx06
output file :
**********
Code:
EMPNO EMPL-NAME SALARY
----- ---------- -------
abc02 krishnamurthy 4,45,687
abc04 mohandasam 7,65,434
abc03 sankarnathan 1,23,409
abc06 sayed kumar 8,76,563
abc05 suresh kumar 1,29,876
abc01 swaminathan 3,24,567
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Do you intend posting some kind of explanation. . .?
Something like the processing rules and how you determined "salary" . . .
Back to top
sqlcode1 Active Member Joined: 08 Apr 2010Posts: 577 Location: USA
Hi,
Try below job. I am assuming some of the field positions as below.
EMP NO. :- 01-8
EMP NAME :- 09-15
SALARY :- 38-06
Your Salary field is missing something. Employees won't get their pennies.
Code:
//SORT01 EXEC PGM=SORT
//SORTIN DD *
ABC01 SWAMINATHAN 20012008 5434324567 PQRSXXX01
ABC02 KRISHNAMURTHY 10102007 5533445687 PQRSXXX02
ABC03 SANKARNATHAN 10022004 6123123409 PQRSXXX03
ABC04 MOHANDASAM 07082003 6213765434 PQRSXXX04
ABC05 SURESH KUMAR 05102008 5956129876 PQRSXXX05
ABC06 SAYED KUMAR 04112008 6023876563 PQRSXXX06
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC BUILD=(01,08,
09,15,
38,06)
SORT FIELDS=(09,15,CH,A)
OUTFIL REMOVECC,
HEADER2=(001:'EMP NO ',
016:'EMPL NAME ',
031:'SALARY ',/,
001:'------ ',
016:'--------- ',
031:'--------- '),
BUILD=(01,08,7X,
09,15,
24,06,ZD,EDIT=(I,II,IIT),07X)
/*
//SYSOUT DD SYSOUT=*
OUTPUT
Code:
EMP NO EMPL NAME SALARY
------ --------- ---------
ABC02 KRISHNAMURTHY 4,45,687
ABC04 MOHANDASAM 7,65,434
ABC03 SANKARNATHAN 1,23,409
ABC06 SAYED KUMAR 8,76,563
ABC05 SURESH KUMAR 1,29,876
ABC01 SWAMINATHAN 3,24,567
Back to top
arunmozhicholan New User Joined: 07 Feb 2007Posts: 27 Location: chennai
Thanks a lot... got the o/p
Back to top
arunmozhicholan New User Joined: 07 Feb 2007Posts: 27 Location: chennai
Got the O/P exactly... May I know about the below mentioned lines
BUILD=(01,08,7X,
09,15,
24,06,ZD,EDIT=(I,II,IIT),07X)
Back to top
William Thompson Global Moderator Joined: 18 Nov 2006Posts: 3156 Location: Tucson AZ
Back to top
viji_rags New User Joined: 04 Jun 2010Posts: 24 Location: chennai
BUILD=(01,08,7X,
09,15,
24,06,ZD,EDIT=(I,II,IIT),07X)
what is the meaning for each and every fields...
Back to top
CICS Guy Senior Member Joined: 18 Jul 2007Posts: 2146 Location: At my coffee table
Back to top
sqlcode1 Active Member Joined: 08 Apr 2010Posts: 577 Location: USA
viji_rags,
Welcome to the Forum.
Please refer to the link posted by William Thompson.
Based on the input data provided in the original post, bytes 1 through 8 represents emp. no. Similarly bytes 9 through 15 and 24,06 represents employee name and employee salary respectively. 7X adds 7 spaces.
Using BUILD we can re-arrange the input data.
Thanks,
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
arunmozhicholan and viji_rags,
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
r arunmoezhi New User Joined: 26 Jun 2009Posts: 32 Location: Chennai
Back to top
Please enable JavaScript!