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

How to change sequential number automatically?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Aug 28, 2009 9:05 am
Reply with quote

Hello, Frank Yaeger,

Thanks for your answer.

If the INPUT file is VB format, job you provided goes wrong.

Can you help with the following error:
Code:
 ICE632I 0 SOURCE FOR ICETOOL STATEMENTS:  TOOLIN                               
                                                                               
                                                                               
 ICE630I 0 MODE IN EFFECT:  STOP                                               
                                                                               
           SUBSET FROM(IN) TO(OUT) FIRST LAST INPUT KEEP USING(CTL1)           
 ICE606I 0 DFSORT CALL 0001 FOR COPY FROM IN       TO OUTFIL   USING CTL1CNTL TE
 ICE602I 0 OPERATION RETURN CODE:  16                                           
                                                                               
                                                                               
 ICE601I 0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE:  16                 
******************************** BOTTOM OF DATA ********************************
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 Aug 28, 2009 8:22 pm
Reply with quote

You didn't say you had a VB file so I didn't code for that. You have to handle a VB file different than an FB file. A VB file has an RDW in positions 1-4 and variable length records. I'm not feeling well today, so I'll ask Kolusu to help you.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Aug 28, 2009 11:35 pm
Reply with quote

dejunzhu,

Use the following DFSORT JCL

Code:

//S1       EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=your input vb file,DISP=SHR
//SORTOUT  DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)     
//SYSIN    DD *                                                     
  INCLUDE COND=(5,3,SS,EQ,C'HDR,TRL')                               
  SORT FIELDS=COPY                                                   
                                                                     
  OUTREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,BUILD=(1,4,5,30,80:X)),       
  IFTHEN=(WHEN=(5,3,CH,EQ,C'HDR'),BUILD=(1,4,C'HCON1,''',5,21,C'''',
  40:C'HSEQNO,''',26,5,ZD,ADD,+1,TO=ZD,LENGTH=5,C''''),HIT=NEXT),   
  IFTHEN=(WHEN=(5,5,CH,EQ,C'HCON1',AND,48,5,ZD,EQ,0),               
  OVERLAY=(48:48,5,ZD,ADD,+1,TO=ZD,LENGTH=5)),                       
  IFTHEN=(WHEN=(5,3,CH,EQ,C'TRL'),BUILD=(1,4,C'TCON1,''',5,12,C''''))
                                                                     
  OUTFIL VTOF,REMOVECC,BUILD=(5,35,80:X),HEADER1=(40,40,80:X)       
/*                                                                   
//S2       EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                               
//SORTIN   DD DSN=Your input file2,DISP=SHR
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD    *                                                   
  OPTION COPY                                                       
  OUTFIL REMOVECC,                                                   
    HEADER1=(HCON1,HSEQNO),                                         
    TRAILER1=(TCON1,COUNT=(EDIT=(TTTTTTT)))                         
/*
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Mon Aug 31, 2009 7:55 am
Reply with quote

Hi,kolusu
thanks for your answer.
The source your provided is effective.
I wan to get the same result with the following source, but error occurred.
Code:
//* -----------------------------------------------------------* 
//S1    EXEC  PGM=ICETOOL                                         
//TOOLMSG   DD  SYSOUT=*                                         
//DFSMSG    DD  SYSOUT=*                                         
//IN        DD DSN=EV6954.LJ84.DS.BPDM.OLD,DISP=SHR  ==>OLD I/F   
//OUT       DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//TOOLIN    DD    *                                               
SUBSET FROM(IN) TO(OUT) FIRST LAST INPUT KEEP USING(CTL1)         
/*                                                               
//CTL1CNTL DD *                                                   
 OUTFIL VTOF,IFOUTLEN=80,                                         
   IFTHEN=(WHEN=(5,3,CH,EQ,C'HDR',AND,32,5,ZD,EQ,99999),         
    BUILD=(C'HCON1,''',5,13,DATENS=(4MD),TIMENS=(24),C'''',/,     
      C'HSEQNO,''00001''',80:X)),                                 
   IFTHEN=(WHEN=(5,3,CH,EQ,C'HDR'),                               
    BUILD=(C'HCON1,''',5,13,DATENS=(4MD),TIMENS=(24),C'''',/,     
      C'HSEQNO,''',32,5,ZD,ADD,+1,TO=ZD,LENGTH=5,C'''',80:X)),   
   IFTHEN=(WHEN=(5,3,CH,EQ,C'TRL'),                               
    BUILD=(C'TCON1,''',5,13,C'''',80:X))                         
/*                                                               
//S2       EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                           
//SORTIN   DD DSN=EV6954.LJ84.DS.UNLOAD.TDDB20,DISP=SHR,         
//          UNIT=3390,VOL=SER=(BFF157,BFF156)                   
//SORTOUT  DD DSN=EV6954.TEST,DISP=(,CATLG),                     
//          UNIT=3390,VOL=SER=BFF234,SPACE=(CYL,(300,100),RLSE),
//          DCB=*.S1.IN                                         
//SYSIN    DD    *                                               
  OPTION COPY                                                   
  OUTFIL REMOVECC,                                               
    HEADER1=(HCON1,HSEQNO),                                     
    TRAILER1=(TCON1,COUNT=(EDIT=(TTTTTTT)))                     
/*                                                               


error message:
Code:
              IFTHEN=(WHEN=(5,3,CH,EQ,C'TRL'),                                 
               BUILD=(C'TCON1,''',5,13,C'''',80:X))                             
 ICE146I 0 END OF STATEMENTS FROM CTL1CNTL - PARAMETER LIST STATEMENTS FOLLOW   
           DEBUG NOABEND,ESTAE                                                 
           OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL1,SORTIN=IN,S
                          TOUT=OUT,DYNALLOC,EQUALS,NOCHECK,COPY                 
           OMIT COND=ALL                                                       
           OUTFIL FNAMES=OUT                                                   
 ICE201I F RECORD TYPE IS V - DATA STARTS IN POSITION 5                         
 ICE126A 9 INCONSISTENT OUT      IFTHEN 1 REFORMATTING FIELD FOUND             
 ICE751I 0 C5-K90013 C6-K90013 C7-K90000 C8-K42135 E9-K90013 E7-K44563         
 ICE052I 3 END OF DFSORT                                                       
******************************** BOTTOM OF DATA ********************************


Would you please help to correct my code?
Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 31, 2009 9:50 am
Reply with quote

Hello,

What business reason is there to not use the working solution provided. . . icon_confused.gif
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Mon Aug 31, 2009 9:57 am
Reply with quote

dick scherrer wrote:
Hello,

What business reason is there to not use the working solution provided. . . icon_confused.gif

No, there is no reason for that.
The working solution can be applied to production environment.

Before the correct solution came out, I tried to do it myself, and the above error occurred.
I just want to find where was wrong with my solution.

Thanks.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Aug 31, 2009 9:46 pm
Reply with quote

dejunzhu,

If you looked up the error message ICE126A with reason code 5 you would have figured out , what went wrong with your JCL

Here read the description for ICE126A

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CM40/2.2.122?

I provided you a solution because I am aware of the limitations and yet you want to go back and do it the wrong way. The following are the reasons why I can't use Subset operator

1. VTOF canNOT be used with an IFTHEN or OVERLAY operand on OUTFIL.
2. You canNOT use OUTREC to perform the formatting with subset operator.
3. Symnames dataset should always be FB recfm and 80 bytes in length.

Considering all the above conditions I gave you a JCL which suits your requirement.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Tue Sep 01, 2009 7:02 am
Reply with quote

hi, Kolusu,
Thanks for your exhaustive explanation sincerely!

I got it and I have unload the book:<<DFSort error code>>.
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 -> DFSORT/ICETOOL Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
Search our Forums:

Back to Top