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 

Add a sequence number to each record of a file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
emadhubabu
Beginner


Joined: 03 Sep 2005
Posts: 13
Topics: 6

PostPosted: Tue May 13, 2008 8:10 am    Post subject: Add a sequence number to each record of a file Reply with quote

HI,

I have a Flat File. Need to add 3 char sequence number before each record.

Please suggest me a JCL, with out using ICE TOOL

Thanks
Maddy
Back to top
View user's profile Send private message
emadhubabu
Beginner


Joined: 03 Sep 2005
Posts: 13
Topics: 6

PostPosted: Tue May 13, 2008 8:12 am    Post subject: Reply with quote

to make it clear.

I/p file:
REC01
REC02
REC03
REC04

Expected O/p:
001REC01
002REC02
003REC03
004REC04
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 13, 2008 8:28 am    Post subject: Reply with quote

Do you know what JCL is? It cannot do what you want. It tells the OS what programs to run, in what sequence and what files those programs need plus some other information. What you are looking for is, possibly a utility program (but why exclude ICETOOL?) or even a quick Rexx program or Easytrieve solution.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Tue May 13, 2008 9:43 am    Post subject: Reply with quote

Maddy,

You can use a DFSORT job like the following to do what you asked for. You didn't give the RECFM and LRECL of the input file, so I assumed it's RECFM=FB and LRECL=5. You can change the job appropriately for other attributes.

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/5)
//SORTOUT DD DSN=...  output file (FB/8)
//SYSIN DD *
  OPTION COPY
  INREC BUILD=(SEQNUM,3,ZD,1,5)
/*


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
emadhubabu
Beginner


Joined: 03 Sep 2005
Posts: 13
Topics: 6

PostPosted: Wed May 14, 2008 1:42 am    Post subject: Reply with quote

HI Frank Yaeger,
I was able to do that in simple SORT too.

OUTREC = ( SEQNUM,3,ZD,4:5)
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Wed May 14, 2008 10:04 am    Post subject: Reply with quote

emadhubabu,

There's no such thing as "simple SORT". You're either using DFSORT, Syncsort or CA-Sort.


Code:

  OUTREC = ( SEQNUM,3,ZD,4:5)


This syntax is invalid as shown in several ways. It has blanks where they don't belong, it has OUTREC= which is only valid for an OUTFIL statement. And it has 4:5 which is only valid for VB records, but would require specifying "1,4," for the RDW before SEQNUM.

So basically, your entire post makes no sense.
_________________
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
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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