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
 

 

SEQNUM : START= from field of the first record ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Thu Nov 12, 2009 12:12 am    Post subject: SEQNUM : START= from field of the first record ?
Reply with quote

I've read it's possible to use SEQNUM followed by START=

But I wonder if the value could be taken from field of the 1st record, so that the procedure is full automatic

Ex. (pos. number=1 to 5 ; FLR = 8) :

00051AAA
00051AAA
00051AAB
00052ABD
00053ABD

must give :
00051AAA
00052AAB
00053ABD
00054ABD

Note : I use a SELECT FIRST... ON(1,8) to eliminate duplicate records on entire record length (8)
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: Thu Nov 12, 2009 12:33 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB)
//OUT DD DSN=...  output file (FB)
//TOOLIN DD *
COPY FROM(IN) TO(CTL2CNTL) USING(CTL1)
SELECT FROM(IN) TO(OUT) ON(1,8,CH) FIRST USING(CTL2)
/*
//CTL1CNTL DD *
  OPTION STOPAFT=1
  INREC BUILD=(C'  OUTFIL FNAMES=OUT,OVERLAY=(1:SEQNUM,5,ZD,START=',
    1,5,C')',80:X)
/*
//CTL2CNTL DD DSN=&&C2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Nov 12, 2009 12:47 am    Post subject: Reply to: SEQNUM : START= from field of the first record ?
Reply with quote

Searchman,

Here is an alternative way of getting the desired results

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=your 8 byte FB file,DISP=SHR     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  SORT FIELDS=(1,8,CH,A),EQUALS                                       
  SUM FIELDS=NONE                                                     
  OUTREC IFOUTLEN=8,IFTHEN=(WHEN=INIT,OVERLAY=(9:SEQNUM,5,ZD,START=0)),
  IFTHEN=(WHEN=GROUP,BEGIN=(9,5,ZD,EQ,0),PUSH=(1:1,5)),               
  IFTHEN=(WHEN=(9,5,ZD,GT,0),                                         
  OVERLAY=(1:1,5,ZD,ADD,9,5,ZD,M11,LENGTH=5))                         
//*
Back to top
View user's profile Send private message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Thu Nov 12, 2009 2:38 am    Post subject: Reply to: SEQNUM : START= from field of the first record ?
Reply with quote

Thank you for the two solutions...
I find the first one (SELECT FIRST) quite elegant !
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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