Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort to get the following o/p files like below

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort to get the following o/p files like below
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

Site Director


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

PostPosted: Wed Jun 16, 2010 9:06 pm    Post subject:
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: 578
Location: USA

PostPosted: Wed Jun 16, 2010 9:09 pm    Post subject:
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    Post subject: Reply to: Sort to get the following o/p files like below
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Jun 17, 2010 11:03 am    Post subject:
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    Post subject: Reply to: Sort to get the following o/p files like below
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: 2150
Location: At my coffee table

PostPosted: Thu Jun 17, 2010 7:04 pm    Post subject:
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: 578
Location: USA

PostPosted: Thu Jun 17, 2010 7:11 pm    Post subject:
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 Moderator


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

PostPosted: Thu Jun 17, 2010 10:28 pm    Post subject:
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:

http://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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us