Query reg moving values to particular records!



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

Query reg moving values to particular records!

Postby maandi » Wed Nov 24, 2010 8:28 pm

Hi All,

I have to move some values to particular field in my input record based on some condition. Is it possible to do that in SORT JCL?

E.g I have a input record like (xxx00000xxxxxxxxxxxxx)

I have to perform the validation : If (Start position(4),length(5)) = zeros, then copy the entire record with repacing ''123" in first 3 bytes. If the validation fails it must copy the record without replacing anything.So each and every record should be there in output.

So my output will look like (12300000xxxxxxxxxxxxxx).

Is it possible to do this in SORT JCL or any other utilities?


Thanks,
Maandy.
maandi
 
Posts: 20
Joined: Sat Oct 30, 2010 1:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: Query reg moving values to particular records!

Postby Frank Yaeger » Wed Nov 24, 2010 11:42 pm

You can use a DFSORT job like the following to do what you asked for:

//S1 EXEC PGM=SORT                                       
//SYSOUT DD SYSOUT=*                                     
//SORTIN DD *                                             
xxx00000xxxxxxxxxxxxx                                     
yyy00001yyyyyyyyyyyyy                                     
zzz00000zzzzzzzzzzzzz                                     
//SORTOUT DD SYSOUT=*                                     
//SYSIN DD *                                             
   OPTION COPY                                           
   INREC IFTHEN=(WHEN=(4,5,CH,EQ,C'00000'),               
     OVERLAY=(1:C'123'))                                 


SORTOUT would have:

12300000xxxxxxxxxxxxx 
yyy00001yyyyyyyyyyyyy 
12300000zzzzzzzzzzzzz 


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

Re: Query reg moving values to particular records!

Postby maandi » Fri Nov 26, 2010 1:22 pm

Hi Frank,

Thanks for your suggestion. The code you mentioned worked out well.

Regards,
Maandy.
maandi
 
Posts: 20
Joined: Sat Oct 30, 2010 1:37 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post