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
 

 

Insert sequence number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nazia.lalani
Warnings : 1

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Fri Sep 11, 2009 10:12 am    Post subject: Insert sequence number
Reply with quote

I want to insert the sequence number at the end of the record depending on icn

ICN sequwnce number

00000001 1
00000001 2
00000001 3
00000001 4
00000002 1
00000002 2

Can any body suggest any solution?
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Sep 11, 2009 10:42 am    Post subject:
Reply with quote

Hi,

insert what sequence number ? where is the end of the record ?what is the LRECL ? RECFM ?.

Give example on what the output will look like.

You need to explain what is needed a lot clearer than you have done so far.


Gerry
Back to top
View user's profile Send private message
nazia.lalani
Warnings : 1

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Fri Sep 11, 2009 10:49 am    Post subject:
Reply with quote

consider the input file is fixed byte and lrec=80
i want to insert sequence number at 81 position

INPUT file has ICN and other fields i want sequence number depending on ICN
1-
80
ICN other fields
00000001 ............................................................
00000001 ............................................................
00000001 ............................................................
00000001 ............................................................
00000002 ............................................................
00000002 ............................................................

output file
INPUT file
1- 81

00000001 ............................................................1
00000001 ............................................................2
00000001 ............................................................ 3
00000001 ............................................................4
00000002 ............................................................1
00000002 ............................................................ 2
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Sep 11, 2009 10:56 am    Post subject:
Reply with quote

Hi,

try this
Code:
//STEP0001 EXEC PGM=SORT                                               
//SORTIN   DD *                                                         
00000001 ............................................................   
00000001 ............................................................   
00000001 ............................................................   
00000001 ............................................................   
00000002 ............................................................   
00000002 ............................................................   
//SORTOUT  DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=(1,8,BI,A)                                               
  OUTREC OVERLAY=(81:SEQNUM,3,ZD,RESTART=(1,8))                         


Gerry
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 Sep 11, 2009 9:14 pm    Post subject:
Reply with quote

Nazia,

If the records are already in order as shown in your example, you can use a copy application which is more efficient than a sort application. Just replace the SORT statement with:

Code:

    SORT FIELDS=COPY
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 SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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