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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 6 Sat Jan 21, 2017 4:02 am
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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