IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort to get the following o/p files like below


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arunmozhicholan

New User


Joined: 07 Feb 2007
Posts: 27
Location: chennai

PostPosted: Wed Jun 16, 2010 8:38 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 16, 2010 9:06 pm
Reply with quote

Hello,

Do you intend posting some kind of explanation. . .?

Something like the processing rules and how you determined "salary" . . .
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Jun 16, 2010 9:09 pm
Reply with quote

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
View user's profile Send private message
arunmozhicholan

New User


Joined: 07 Feb 2007
Posts: 27
Location: chennai

PostPosted: Thu Jun 17, 2010 10:44 am
Reply with quote

Thanks a lot... got the o/p
Back to top
View user's profile Send private message
arunmozhicholan

New User


Joined: 07 Feb 2007
Posts: 27
Location: chennai

PostPosted: Thu Jun 17, 2010 10:51 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jun 17, 2010 11:03 am
Reply with quote

FIELDS or BUILD?
Or was it the EDIT?
Back to top
View user's profile Send private message
viji_rags

New User


Joined: 04 Jun 2010
Posts: 24
Location: chennai

PostPosted: Thu Jun 17, 2010 6:40 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jun 17, 2010 7:04 pm
Reply with quote

arunmozhicholan or viji_rags?
Two people that don't/won't/can't RTFM?

Try z/OS V1R11.0 DFSORT: Getting Started and z/OS V1R11.0 DFSORT Application Programming Guide.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Jun 17, 2010 7:11 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jun 17, 2010 10:28 pm
Reply with quote

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
View user's profile Send private message
r arunmoezhi

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Mon Jun 21, 2010 5:00 pm
Reply with quote

Just to justify Franks statement :
Quote:

It's an excellent tutorial, with lots of examples

Table 43. Edit Mask Patterns
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top