View previous topic :: View next topic
|
Author |
Message |
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
suppose input file is like
Rahul
Mohan
Raman
Tina
I want output file like
1 Rahul
2 Mohan
3 Raman
4 Tina
how can i do this operation?
whether this can be done in sort or any other thing?
tell me the code for that if possible |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Rahul,
Use this JCL and change according to your requirements.
What is the i/p and output record length?
Max no of records in the file? this is just to code the length of the seqnum.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RAHUL
MOHAN
RAMAN
TINA
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC BUILD=(1:SEQNUM,1,ZD,C' ',1,80)
/*
|
Please answer the above questions to get the final JCL. |
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
I have the file of somewhere arnd 10000 + records
tell me for that |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Rahul,
Change this
Quote: |
INREC BUILD=(1:SEQNUM,1,ZD,C' ',1,80) |
to
Code: |
INREC BUILD=(1:SEQNUM,6,ZD,C' ',1,80) |
|
|
Back to top |
|
|
scorp_rahul22 Currently Banned New User
Joined: 06 Aug 2007 Posts: 42 Location: chennai
|
|
|
|
what exactly that statement do?
can u explain that in detail.
what is the purpose of changing from 1 to 6 |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Rahul,
Quote: |
what exactly that statement do?
can u explain that in detail.
what is the purpose of changing from 1 to 6 |
Just code that and see and you should be able to find the difference. Anyways here is the answer.
Quote: |
I have the file of somewhere arnd 10000 + records
|
You had mentioned that you will have 10000+ records and hence your sequence no's should be atleast 5 bytes in length. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
scorp_rahul22,
I deleted your post with the new requirement. Please start a new topic for it. And use ubb code tags around your examples so they will line up correctly. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|