MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inserting zeroes at end of each record(decimal format).

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
rajkumar_1981
Beginner


Joined: 05 Jan 2007
Posts: 5
Topics: 4

PostPosted: Wed May 14, 2008 11:21 pm    Post subject: Inserting zeroes at end of each record(decimal format). Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu May 15, 2008 1:28 am    Post subject: Reply with quote

This is the link to the sticky that frank created for dfsort manuals
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu May 15, 2008 1:59 am    Post subject: Re: INSERTING ZEROES AT END OF EACH RECORD (decimal format). Reply with quote

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
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu May 15, 2008 9:48 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Oct 17, 2008 5:49 am    Post subject: Another way. Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Fri Oct 17, 2008 10:35 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Oct 17, 2008 11:38 am    Post subject: Reply with quote

well.....What am I doing here? angry bonk

that is very important point I forgot and trying to show my knowledge to a brilliant like you.........sorry..........sorry...... Mr. Green Embarassed Sad

Bye.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Oct 17, 2008 12:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sat Oct 18, 2008 1:04 am    Post subject: Reply with quote

No comments
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group