Insert a "countfield"



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

Insert a "countfield"

Postby LasseH » Thu May 12, 2011 5:00 pm

Is it possible to "insert" a countfield (with ; after) first in each record

Input:
aaa;bbb;ccc;
aaa:bbb:ddd:

output:
000001;aaa;bbb;ccc;
000002;aaa;bbb;ddd;

//Lasse
LasseH
 
Posts: 50
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 3 times
Been thanked: 1 time

Re: Insert a "countfield"

 

Re: Insert a "countfield"

Postby skolusu » Thu May 12, 2011 10:01 pm

LasseH,

Use the following DFSORT JCL which will give you the desired results

//STEP0100 EXEC PGM=SORT               
//SYSOUT   DD SYSOUT=*                 
//SORTIN   DD *                         
----+----1----+----2----+----3----+----4
AAA;BBB;CCC;                           
AAA:BBB:DDD:                           
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                         
  SORT FIELDS=COPY                     
  INREC BUILD=(SEQNUM,6,ZD,C';',1,12)   
//*


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
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Insert a "countfield"

Postby LasseH » Fri May 13, 2011 4:10 pm

That did it. tnkx
LasseH
 
Posts: 50
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 3 times
Been thanked: 1 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post