Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to introduce sequence number in beginning of file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Fri Dec 07, 2007 11:14 am    Post subject: how to introduce sequence number in beginning of file
Reply with quote

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

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Dec 07, 2007 1:44 pm    Post subject: Reply to: how to introduce sequence number in beginning of f
Reply with quote

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
View user's profile Send private message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Fri Dec 07, 2007 3:08 pm    Post subject: how to introduce sequence number in beginning of file
Reply with quote

I have the file of somewhere arnd 10000 + records

tell me for that
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Dec 07, 2007 3:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
scorp_rahul22
Currently Banned

New User


Joined: 06 Aug 2007
Posts: 42
Location: chennai

PostPosted: Fri Dec 07, 2007 3:31 pm    Post subject:
Reply with quote

what exactly that statement do?

can u explain that in detail.
what is the purpose of changing from 1 to 6
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Dec 07, 2007 4:17 pm    Post subject: Reply to: how to introduce sequence number in beginning of f
Reply with quote

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

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Dec 07, 2007 10:15 pm    Post subject:
Reply with quote

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

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Dec 07, 2007 10:19 pm    Post subject:
Reply with quote

scorp_rahul22,

For more information on DFSORT's SEQNUM function, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.20?DT=20060615173822

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
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us