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

Hex count insertion at footer


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

Senior Member


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

PostPosted: Tue Jul 21, 2009 4:14 am
Reply with quote

khamaurutheen,

The posted job works fine for me . If you say it is not working then I need to see your control cards and the sysout messages.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Tue Jul 21, 2009 9:16 pm
Reply with quote

Please see my sysout.

Code:
PROCESSING SYMNAMES STATEMENTS                                               
ORIGINAL STATEMENTS FROM SYSIN    FOLLOW                                     
  SORT FIELDS=COPY                                                           
  INREC IFOUTLEN=2000,                                                       
  IFTHEN=(WHEN=INIT,OVERLAY=(2001:SEQNUM,5,PD)),                             
  IFTHEN=(WHEN=(01,10,CH,EQ,TVAL,AND,11,10,CH,EQ,TVAL,AND,                   
                21,10,CH,EQ,TVAL,AND,31,10,CH,EQ,TVAL,AND,                   
                41,10,CH,EQ,TVAL,AND,51,10,CH,EQ,TVAL,AND,                   
                61,10,CH,EQ,TVAL,AND,71,01,CH,EQ,X'FF'),                     
  OVERLAY=(81:2001,5))                                                       
PERFORMING SYMBOL SUBSTITUTION AS NEEDED                                     
BLOCKSET     COPY  TECHNIQUE SELECTED                                         
VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE 
- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 11:43 ON TUE JUL 21, 20
 SORT FIELDS=COPY                                                             
 INREC IFOUTLEN=2000,IFTHEN=(WHEN=INIT,OVERLAY=(2001:SEQNUM,5,PD)),IFTH*     
               EN=(WHEN=(01,10,CH,EQ,X'FFFFFFFFFFFFFFFFFFFF',AND,11,10,*     
               CH,EQ,X'FFFFFFFFFFFFFFFFFFFF',AND,21,10,CH,EQ,X'FFFFFFFF*     
  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 FFFFFFFFFFFF',AND,31,10,CH,EQ,X'FFFFFFFFFFFFFFFFFFFF',AN*   
 D,41,10,CH,EQ,X'FFFFFFFFFFFFFFFFFFFF',AND,51,10,CH,EQ,X'*   
 FFFFFFFFFFFFFFFFFFFF',AND,61,10,CH,EQ,X'FFFFFFFFFFFFFFFF*   
 FFFF',AND,71,01,CH,EQ,X'FF'),OVERLAY=(81:2001,5))           


OUTPUT LRECL = 2000, BLKSIZE = 18000, TYPE = FB
INSERT 0, DELETE 0
RECORDS - IN: 2469, OUT: 2469
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Jul 21, 2009 10:26 pm
Reply with quote

khamarutheen,

I don't see any thing obvious that would pinpoint as to why it does not work for you. Run this job and see how many records you got in your sortout dataset.

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYMNAMES DD *                                           
TVAL,X'FFFFFFFFFFFFFFFFFFFF'                               
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=Your input file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INCLUDE COND=(01,10,CH,EQ,TVAL,AND,11,10,CH,EQ,TVAL,AND,
                21,10,CH,EQ,TVAL,AND,31,10,CH,EQ,TVAL,AND,
                41,10,CH,EQ,TVAL,AND,51,10,CH,EQ,TVAL,AND,
                61,10,CH,EQ,TVAL,AND,71,01,CH,EQ,X'FF')   
/*
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Wed Jul 22, 2009 11:34 pm
Reply with quote

RECORDS - IN: 2469, OUT: 1

In sysout i can see one record has been available.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Wed Jul 22, 2009 11:36 pm
Reply with quote

O/P file look slike below

Code:
6----+----7----+----8----+-
  20090714M  Ìì 
FFFFFFFFFFFFFFFFFFFFD00752F
FFFFFFFFFFFF2009071440088CF
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Jul 22, 2009 11:46 pm
Reply with quote

khamarutheen,

can you send me the complete Sysout from job as well as the input dataset offline to skolusu@us.ibm.com and I will take a look at it

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

Senior Member


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

PostPosted: Fri Jul 24, 2009 3:31 am
Reply with quote

khamarutheen,

I looked at the offline messages and the OPTION SOLRF is the culprit. If your System Programmers changed the shipped default from SOLRF=YES to SOLRF=NO, you might want to ask them why they did that as it can cause some very unexpected results.

So you need to Override that parm with the following statement. Add the OPTION SOLRF as your first statement in SYSIN and then followed by your sort fields and Inrec statements. Use the following control cards and re-run your job.

EX:

Code:

//SYSIN    DD *
  OPTION SOLRF                                             
  SORT FIELDS=COPY                                         
  INREC IFOUTLEN=2000,                                     
  IFTHEN=(WHEN=INIT,OVERLAY=(2001:SEQNUM,5,PD)),           
  IFTHEN=(WHEN=(01,10,CH,EQ,TVAL,AND,11,10,CH,EQ,TVAL,AND,
                21,10,CH,EQ,TVAL,AND,31,10,CH,EQ,TVAL,AND,
                41,10,CH,EQ,TVAL,AND,51,10,CH,EQ,TVAL,AND,
                61,10,CH,EQ,TVAL,AND,71,01,CH,EQ,X'FF'),   
  OVERLAY=(81:2001,5))                                     
/*
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Fri Jul 24, 2009 4:00 am
Reply with quote

No luck kolusu!
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jul 24, 2009 4:38 am
Reply with quote

Hi Skolusu,

you mentioned this
Quote:
I looked at the offline messages and the OPTION SOLRF is the culprit. If your System Programmers changed the shipped default from SOLRF=YES to SOLRF=NO, you might want to ask them why they did that as it can cause some very unexpected results


Why make an option available if the results are unpredictable ?


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

Senior Member


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

PostPosted: Fri Jul 24, 2009 4:42 am
Reply with quote

khamarutheen,

Are you sure that you are looking at the correct output file for the count? Are you using the same file as input and output? You canNOT use the same input file for output also for a COPY operation.

Run the following job as with just changing the input filename and show me the contents of OUT from step0200

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYMNAMES DD *                                               
TVAL,X'FFFFFFFFFFFFFFFFFFFF'                                   
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=Your input file,DISP=SHR
//SORTOUT  DD DSN=&&O1,DISP=(,PASS),SPACE=(CYL,(40,20),RLSE)     
//SYSIN    DD *
  OPTION SOLRF                                               
  SORT FIELDS=COPY                                             
  INREC IFOUTLEN=2000,                                         
  IFTHEN=(WHEN=INIT,OVERLAY=(2001:SEQNUM,5,PD)),               
  IFTHEN=(WHEN=(01,10,CH,EQ,TVAL,AND,11,10,CH,EQ,TVAL,AND,     
                21,10,CH,EQ,TVAL,AND,31,10,CH,EQ,TVAL,AND,     
                41,10,CH,EQ,TVAL,AND,51,10,CH,EQ,TVAL,AND,     
                61,10,CH,EQ,TVAL,AND,71,01,CH,EQ,X'FF'),       
  OVERLAY=(81:2001,5))                                         
/*                                                             
//STEP0200 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN       DD DSN=Your input file,DISP=SHR
//RES      DD DSN=&&O1,DISP=SHR                         
//OUT      DD SYSOUT=*                                   
//TOOLIN   DD *                                           
  SUBSET FROM(IN)  TO(OUT) INPUT KEEP LAST USING(CTL1)   
  SUBSET FROM(RES) TO(OUT) INPUT KEEP LAST USING(CTL1)   
//CTL1CNTL DD *                                           
  OUTFIL FNAMES=OUT,BUILD=(1,71,/,81,5,PD,M10,LENGTH=10) 
/*
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 Jul 24, 2009 4:54 am
Reply with quote

Quote:
Why make an option available if the results are unpredictable ?


"unexpected" was the word Kolusu correctly used, not "unpredictable".

NOSOLRF works in a perfectly predictable manner, but it may not be working in the manner you expect if you don't understand that the shipped default of SOLRF has been changed to NOSOLRF. SOLRF lets DFSORT use the length of the reformatted record as you would expect it to do. NOSOLRF prevents DFSORT from using the reformatted record length and instead uses the input length. That's NOT what you want to do in most cases and you may not realize the default option has been changed so to you that's an unexpected result. But it is predictable.

The reason we allow the user to change the shipped default from SOLRF to NOSOLRF is to allow DFSORT to work the way it used to work when it only worked as if NOSOLRF was specified (before we added the SOLRF option). Some customers (especially those from Japan) always want to be able to have DFSORT run the way it used to run, so when we supply a new option that changes things, we give them an option to do it the old way. SOLRF is the new way. NOSOLRF is the old way. We recommend using SOLRF as shipped, but we allow them to set NOSOLRF if they really want to. They would have gotten really angry if we didn't let them do it the old way. We would have preferred to do only do it the new way, but they don't give us that choice. The best we can do is set the new way as the shipped default and let them change it if they want to which is what we did. Developers and customers don't always see eye to eye on the right way to do something so we sometimes have to compromise.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Tue Jul 28, 2009 12:52 am
Reply with quote

Kolusu,

I could see in out the data is written correctly.


Code:
     78582     
               
      2469   


Now the concern is, in my JCL STep1 --> copies the header record, Step2--> copies the particular account number STep3 --> Copies the trailer record. Now after copying the trailer record we need to update the total count. What should be modified now? Please advice.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Jul 28, 2009 3:08 am
Reply with quote

khamarutheen,

*Sigh*. For about a week the provided job is indeed providing the correct results. However you coded your own logic to copy the header and trailer records and you complain that the suggested solution does not work.

It is really hard to provide solutions with a moving target. After 3 pages of discussion and solutions provided now you are telling that you have a new requirement? icon_neutral.gif

Just for the record you really don't need 3 different steps to copy the records with header and update the trailer accordingly.

Unless you provide the complete details there is nothing I can do to help you.

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

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Fri Jul 31, 2009 5:07 am
Reply with quote

Code:
//***************COPY HEADER RECORD**********************************   
//STP01 EXEC PGM=EQQDELDS                                               
//TAPE EXEC PGM=SORT                                                   
//SORTLIB  DD  DSN=SYS1.SORTLIB,DISP=SHR                               
//SORTIN   DD DSN=PRD.WRP.P55N.HSD.MTI.G3(-6),               
//         DISP=SHR                                                     
//SORTOUT  DD DSN=SSYG.WRP.PD5N.HLD.MULTI.TEST,                 
//     DISP=(,CATLG,DELETE),DCB=*.SORTIN,SPACE=(CYL,(100,100),RLSE),   
//     UNIT=SYSDA                                                       
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=COPY,                                                     
  STOPAFT=1                                                             
/*                                                                     
//*******************************************************************   
//***************COPY M-RDF NUMBER************************************ 
//STEPM1 EXEC PGM=SORT                                                 
//SORTLIB  DD  DSN=SYS1.SORTLIB,DISP=SHR                               
//SORTIN   DD DSN=PRD.WRP.P55N.HSD.MTI.G3(-6),             
//         DISP=SHR                                                   
//SORTOUT  DD DSN=SSYG.WRP.PD5N.HLD.MULTI.TEST,               
//     DISP=(MOD,CATLG,DELETE),                                       
//     UNIT=SYSDA                                                     
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                     
  INCLUDE COND=(1,2,CH,EQ,C'SD')                                       
/*                                                                     
//*******************************************************************   
//********************COPY TRAILER RECORD***************************** 
//*STEP1   EXEC  PGM=ICETOOL                                           
//*TOOLMSG   DD  SYSOUT=*                                               
//*DFSMSG    DD  SYSOUT=*                                               
//*INDD DD DSN=PRD.WRP.P55N.HSD.MTI.G3(-6),                 
//*          DISP=SHR                                                   
//*OUTDD DD DSN=SSYG.WRP.PD5N.HLD.MULTI.TEST,                   
//*         DISP=(MOD,CATLG,DELETE)                                     
//*TOOLIN DD *                                                         
//* SUBSET FROM(INDD) TO(OUTDD) KEEP INPUT LAST                         
//**                                                                   
//**************pgm by kolusu**********************
//********************COPY TRAILER RECORD***************************** 
//STEP1   EXEC  PGM=ICETOOL                                             
//TOOLMSG   DD  SYSOUT=*                                               
//DFSMSG    DD  SYSOUT=*                                               
//INDD DD DSN=PROD.WRAP.PDND655N.HSEHLD.MULTI.G3(-6),                   
//          DISP=SHR                                                   
//OUTDD DD DSN=SSYG.WRAP.PDND655N.HSEHLD.MULTI.TEST,                   
//         DISP=(MOD,CATLG,DELETE)                                     
//TOOLIN DD *                                                           
// SUBSET FROM(INDD) TO(OUTDD) KEEP INPUT LAST                         
//                                                                     
//STEP0105 EXEC PGM=SORT                                               
//SYMNAMES DD *                                                         
TVAL,X'FFFFFFFFFFFFFFFFFFFF'                                           
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=PRD.WRP.P55N.HSD.MTI.G3(-6),DISP=SHR       
//SORTOUT  DD DSN=SSYG.WRP.PD5N.HLD.MULTI.TEST,                 
//*        DISP=(,PASS),SPACE=(CYL,(40,20),RLSE)                       
//         DISP=(MOD,CATLG,DELETE)                               
//SYSIN    DD *                                                 
  OPTION SOLRF                                                   
  SORT FIELDS=COPY                                               
  INREC IFOUTLEN=2000,                                           
  IFTHEN=(WHEN=INIT,OVERLAY=(2001:SEQNUM,5,PD)),                 
  IFTHEN=(WHEN=(01,10,CH,EQ,TVAL,AND,11,10,CH,EQ,TVAL,AND,       
                21,10,CH,EQ,TVAL,AND,31,10,CH,EQ,TVAL,AND,       
                41,10,CH,EQ,TVAL,AND,51,10,CH,EQ,TVAL,AND,       
                61,10,CH,EQ,TVAL,AND,71,01,CH,EQ,X'FF'),         
  OVERLAY=(81:2001,5))                                           
/*                                                               

//STEP0200 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN       DD DSN=PRD.WRP.P55N.HSD.MTI.G3(-6),DISP=SHR   
//RES      DD DSN=SSYG.WRP.PD5N.HLD.MULTI.TEST,DISP=SHR     
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                     
  SUBSET FROM(IN)  TO(OUT) INPUT KEEP LAST USING(CTL1)               
  SUBSET FROM(RES) TO(OUT) INPUT KEEP LAST USING(CTL1)               
//CTL1CNTL DD *                                                     
  OUTFIL FNAMES=OUT,BUILD=(1,71,/,81,5,PD,M10,LENGTH=10)             
/*       



1. What is the LRECL and RECFM of the file
Record format . . . : FB
Record length . . . : 2000
Block size . . . . : 18000


2. How is the header record identified?
Step "TAPE" Will identify the header record

3. How is the detail record identified?
Step "STEPM1" Will identify all the details inside the record

4. How is the trailer record identified?
Step "STEP1" was coded before now it was commented

5. Do you need to eliminate any records ?( ex duplicates...or include cond)
Yes . INCLUDE COND=(1,2,CH,EQ,C'SD') Here "SD" is the particular account group to be elimnated


6. Does the count on trailer include the header and trailer records also? Assuming you have
10 detail records and 1 header and 1 trailer , does the count on the trailer record say 12 or 10 considering only the detailed records?
Everything is included
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Jul 31, 2009 10:27 pm
Reply with quote

khamarutheen,

Delete ALL the steps you have and just run this 1 single step which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYMNAMES DD *                                                         
TVAL,X'FFFFFFFFFFFFFFFFFFFF'                                           
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=PRD.WRP.P55N.HSD.MTI.G3(-6),DISP=SHR       
//SORTOUT  DD DSN=SSYG.WRP.PD5N.HLD.MULTI.TEST,                 
//*        DISP=(NEW,CATLG,DELETE),
//         SPACE=(CYL,(40,20),RLSE)                       
//SYSIN    DD *                                           
  OPTION SOLRF                                             
  SORT FIELDS=COPY                                         
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(2001:SEQNUM,5,PD)),     
  IFTHEN=(WHEN=(2001,5,PD,EQ,1),OVERLAY=(2006:C'P')),     
  IFTHEN=(WHEN=(1,2,CH,EQ,C'SD'),OVERLAY=(2006:C'P')),     
  IFTHEN=(WHEN=(01,10,CH,EQ,TVAL,AND,11,10,CH,EQ,TVAL,AND,
                21,10,CH,EQ,TVAL,AND,31,10,CH,EQ,TVAL,AND,
                41,10,CH,EQ,TVAL,AND,51,10,CH,EQ,TVAL,AND,
                61,10,CH,EQ,TVAL,AND,71,01,CH,EQ,X'FF'),   
  OVERLAY=(2006:C'T'))                                     
                                                           
  OUTREC IFTHEN=(WHEN=(2006,1,SS,EQ,C'P,T'),               
  OVERLAY=(2007:SEQNUM,5,PD),HIT=NEXT),                   
  IFTHEN=(WHEN=(2006,1,SS,EQ,C'T'),                       
  OVERLAY=(81:2007,5))                                     
                                                           
  OUTFIL BUILD=(1,2000),INCLUDE=(2006,1,SS,EQ,C'P,T')     
/*
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Sat Aug 01, 2009 12:12 am
Reply with quote

Perfect Kolusu!

Works wonderful! icon_lol.gif

I am sorry if i made you painful.
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 To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Count the number of characters in a f... CA Products 1
Search our Forums:

Back to Top