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 4:43 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.

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 maandi » Wed Nov 24, 2010 5:03 pm

maandi wrote: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.

So my output will look like (12300000xxxxxxxxxxxxxx).

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


Thanks,
Maandy.
Hi All...

In the above query i forgot to include one more condition....

If this validation : If (Start position(4),length(5)) = zeros, FAILS then it should copy the record without replacing anything.
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 skolusu » Wed Nov 24, 2010 10:29 pm

maandi,

The following DFSORT JCL will give you the desired results

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
XXX00000XXXXXXXXXXXXX                                 
XXXAAAAAXXXXXXXXXXXXX                                 
XXXCCCCCXXXXXXXXXXXXX                                 
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                     
  INREC IFTHEN=(WHEN=(4,5,ZD,EQ,0),OVERLAY=(1:C'123'))
//*


The output from this job is
12300000XXXXXXXXXXXXX
XXXAAAAAXXXXXXXXXXXXX
XXXCCCCCXXXXXXXXXXXXX
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: Query reg moving values to particular records!

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

Hi Kolusu,

Thanks a lot.. Your code worked out well.
Since i am new to JCL, it helped me a lot.

Could u please elaborate on ZD(Zonned decimal). What does it mean and how we could use that?

Thanks,
Mandy
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 » Tue Nov 30, 2010 12:06 am

For details on DFSORT's various formats (such as CH, ZD, PD, BI, FI, etc), see:

http://publibz.boulder.ibm.com/cgi-bin/ ... 0630155256

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