IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to introduce sequence number in beginning of file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1287
Location: Chennai, India

PostPosted: Fri Dec 07, 2007 1:44 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Fri Dec 07, 2007 3:12 pm
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
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: 1287
Location: Chennai, India

PostPosted: Fri Dec 07, 2007 4:17 pm
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 Developer


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

PostPosted: Fri Dec 07, 2007 10:15 pm
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 Developer


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

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

scorp_rahul22,

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

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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top