File format



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

File format

Postby mahesh100 » Fri Aug 21, 2009 12:14 am

Hi,

I have requirement to format the file.

File Format:

HEADER RECORD
AUS,AUSTRLIA,0,1
GBP,GREAT BRITIAN,1,0
ABW,ARUBA,1,1
BRA,BRAZIL,0,0
TRAILOR RECORD

i Want the GBP as first record always and followed remaining records in ascending order.
Ascending by first three characters

HEADER RECORD
GBP,GREAT BRITIAN,1,0
ABW,ARUBA,1,1
AUS,AUSTRLIA,0,1
BRA,BRAZIL,0,0
TRAILOR

Please let me know any help on this to achive.

Thanks,
Mahesh
mahesh100
 
Posts: 12
Joined: Thu Aug 20, 2009 11:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File format

Postby Frank Yaeger » Fri Aug 21, 2009 1:11 am

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN DD *
HEADER RECORD
AUS,AUSTRLIA,0,1
GBP,GREAT BRITIAN,1,0
ABW,ARUBA,1,1
BRA,BRAZIL,0,0
BRA,BRAZIL,0,1
TRAILOR RECORD
/*
//OUT DD SYSOUT=*
//TOOLIN   DD    *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'1')),
    IFTHEN=(WHEN=(1,3,CH,EQ,C'GBP'),OVERLAY=(81:C'0'))
  SORT FIELDS=(81,1,CH,A,1,3,CH,A)
  OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: File format

Postby mahesh100 » Mon Aug 31, 2009 6:23 pm

Frank,

Thanks Very Much Frank....
I was just thinking , DFSORT is one area where I need to Learn alot as things become pretty easy.
I was surpised by the power of usage of DFSORT.

Let me know for any Suggestions.. I have started with Beginners.

Thanks,
Mahe
mahesh100
 
Posts: 12
Joined: Thu Aug 20, 2009 11:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File format

Postby Frank Yaeger » Mon Aug 31, 2009 9:39 pm

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? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post