View previous topic :: View next topic |
Author |
Message |
rajkumar_1981 Beginner
Joined: 05 Jan 2007 Posts: 5 Topics: 4
|
Posted: Wed May 14, 2008 11:21 pm Post subject: Inserting zeroes at end of each record(decimal format). |
|
|
zeroes are inserted at end of each record in a PS file (decimal format).
No duplicates are there in input file.
for example:
Input file has record lenght is 10 and record format=FB.
Output file has record lenght is 15 and record format=FB.
Input file:
-----------
1234567890
2345754332
2234566777
2234556767
output file:
-----------
123456789000000
234575433200000
223456677700000
223455676700000 |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Thu May 15, 2008 1:59 am Post subject: Re: INSERTING ZEROES AT END OF EACH RECORD (decimal format). |
|
|
rajkumar,
You can try the below code.
Code: | //S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1:1,10,11:C'00000')
/*
//SORTIN DD *
1234567890
2345754332
2234566777
2234556767
//SORTOUT DD SYSOUT=*
//* |
SORTOUT
Code: | 123456789000000
234575433200000
223456677700000
223455676700000 |
|
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu May 15, 2008 9:48 am Post subject: |
|
|
Rajkumar,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/10)
//SORTOUT DD DSN=... output file (FB/15)
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(11:5C'0')
/*
|
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:
www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Oct 17, 2008 5:49 am Post subject: Another way. |
|
|
Hi,
Another way of achieving it !
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1234567890
2345754332
2234566777
2234556767
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,10,11,1,
CHANGE=(11,X'40',C'00000'),NOMATCH=(C' '))
/*
|
Output:
Code: |
123456789000000
234575433200000
223456677700000
223455676700000
|
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Oct 17, 2008 10:35 am Post subject: |
|
|
mf_user,
Did you read the requirements properly? The input lrecl is only 10 bytes and since you are trying to change the 11th byte you would get an error FIELD BEYOND MAXIMUM RECORD LENGTH. secondly you used 11 in the change operator , so it would create a 21 output lrecl when OP only wanted 15 byte records. please understand the question and test your solutions before you post them. Posting incorrect solutions will only cause confusion
Thanks _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Oct 17, 2008 11:38 am Post subject: |
|
|
well.....What am I doing here?
that is very important point I forgot and trying to show my knowledge to a brilliant like you.........sorry..........sorry......
Bye. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Oct 17, 2008 12:10 pm Post subject: |
|
|
And further why would you want to show a more complex solution when a simpler solution has already been posted. Are you trying to show how to do things badly? _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Sat Oct 18, 2008 1:04 am Post subject: |
|
|
No comments _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
|
|
|