MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Changing the Field value for specific records
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Mon Mar 06, 2006 1:50 am    Post subject: Changing the Field value for specific records Reply with quote

My requirement is like below , I have records like this:

The Input file is VSAM File with AVg.rec length as 100 and Max.Reclength as 2315.

CME 00001 *&&^&^ 200
CME 00001 *&&^&^ 200
CME 00001 *&&^&^ 200
CTS 00001 *&&^&^ 200
CTS 00001 *&&^&^ 200
CVE 00001 *&&^&^ 200
CVE 00001 *&&^&^ 200
CVE 00001 *&&^&^ 200
.........
........

The Records with CTS in the first field needs their second field to be changed to 20000 and Fourth field to 400.

In File1 , I can include only those records with CTS and with Change option in Sort i can modify those fieds.

In File2,
I can remove the records with CTS and include other records.

In File3 , I can merge these to files , but the problem is Final Ordering won't be the same as the input file.

Our shop don't have FILE_AID , can it be possible in JCL???
Back to top
View user's profile Send private message
Ravi
Beginner


Joined: 27 Jun 2005
Posts: 88
Topics: 2

PostPosted: Mon Mar 06, 2006 2:17 am    Post subject: Reply with quote

Whatz the Input file layout?
Back to top
View user's profile Send private message
singhnarender79
Beginner


Joined: 24 Dec 2002
Posts: 32
Topics: 6
Location: U.K

PostPosted: Mon Mar 06, 2006 9:14 am    Post subject: Reply with quote

To solve the problem of ordering, why don't you use SEQNUM and assign a unique numer to all the records and then do what u have said above.

Finally after merge, sort on the seqnum again. So you will get the O/P file in the same order as the input file.

Cheers,
Naren
_________________
"Hold fast to dreams, for if dreams die, life is a broken winged bird that cannot fly."

-- Langston Hughes
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Mon Mar 06, 2006 9:42 am    Post subject: Reply with quote

mainframemouli,

You can do it in one step without splitting the file using a CHANGE command or OVERLAY command depending on the version of SORT product you have.

Please provide the DCB properties of the input and output datasets along with the fields positions and lengths that are involved in the change

Hope this helps....

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Mar 06, 2006 11:14 am    Post subject: Reply with quote

You can use a DFSORT job like the one below to do what you asked for. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN and OVERLAY functions. Only DFSORT has these functions, so if you don't have DFSORT, you won't be able to use them. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/



Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  VSAM input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
   OPTION COPY
   RECORD TYPE=V
   INREC IFTHEN=(WHEN=(5,3,CH,EQ,C'CTS'),
     OVERLAY=(9:C'20000',22:C'400'))
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Tue Mar 07, 2006 1:04 am    Post subject: Reply with quote

I am getting the error message when i tried to use INREC WHEN
may be as frank , my shop doesn't have that DFSORT PTF 2004 .

The error message is as below

SYNCSORT FOR Z/OS 1.1BR TPF3A U.S. PATENTS:
SYSIN :
OPTION COPY
RECORD TYPE=V
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'CTS'),
*
OVERLAY=(141:C'R8401 '))

still can it be possible in JCl????? ,Doing it in a single step .

The following are the attributes of the input file

Code:

VSAM Cluster Attributes:                                                     
   CI size  . . . . . 4096     size of the data control intervals             
   Buffer space . . . 12288    buffer space to be allocated at open time     
                                                                             
   Share options .    Cross region . 2          Cross systems  3             
   Process options    Reuse  . . . . N          Recovery . . . Y             
                      Spanned  . . . N          Erase  . . . . N             
                      Extended . . . N          Extended addr  N             
                      Compressed . . N          Writecheck . . N             


Code:

VSAM Data Allocation:                                                         
   Allocation unit  . CYL      REC, KB, MB, TRK, or CYL                       
                                                                             
   Space . . . . .    Primary . . 125           Secondary . 20               
   
                                                                      More:   - +
      Space . . . . .    Primary . . 125           Secondary . 20               
      Record size . .    Average . . 100           Maximum . . 2041             
      Free space . .     % of CI . . 12            % of CA . . 4                 
                                                                                 
      Volume serial(s) . S59382                                                 
      Device type(s) . . 3390                                                   
                                                                                 
   VSAM Key Definition:                                                         
      Key length . . . . 56               Key offset  . . 0                 



Code:

VSAM Index Allocation:                                                     
   CI size  . . . . . 4096     size of the index control intervals         
   Allocation unit  . TRK      REC, KB, MB, TRK, or CYL                     
                                                                           
   Space . . . . .    Primary . . 11            Secondary . 2               
                                                                           
   Volume serial(s) . S59615                                               
   Device type(s) . . 3390                     


1:3 of Input file where 'CTS' present
I need to change the values in
76:5
81:60
141:6
Positions

A program is written for it and done , but to know how it can be done in JCL...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Mar 07, 2006 10:09 am    Post subject: Reply with quote

Quote:

1:3 of Input file where 'CTS' present
I need to change the values in
76:5
81:60
141:6
Positions


mainframemouli,

Try this job. change aaa,bbbb,cccc to desired text.

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=YOUR INPUT VSAM CLUSTER,
//            DISP=OLD                     
//SORTOUT  DD DSN=YOUR OUTPUT FILE,
//            DISP=YOUR OUTPUT FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=PROD,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *                                                       
  SORT FIELDS=COPY                                                 
  OUTREC FIELDS=(0001,0075,                                         
                 0076:1,3,CHANGE=(05,C'CTS',C'AAAAA'),             
                                  NOMATCH=(076,05),                 
                 0081:1,3,CHANGE=(60,C'CTS',                       
  C'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'),
                                  NOMATCH=(081,60),                 
                 0141:1,3,CHANGE=(06,C'CTS',C'CCCCCC'),             
                                  NOMATCH=(141,06),                 
                 0147,2169)                                         
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Mar 07, 2006 11:41 am    Post subject: Reply with quote

Quote:
I am getting the error message when i tried to use INREC WHEN
may be as frank , my shop doesn't have that DFSORT PTF 2004 .

The error message is as below

SYNCSORT FOR Z/OS 1.1BR TPF3A U.S. PATENTS:


Actually, your shop is using Syncsort, not DFSORT. DFSORT supports IFTHEN and OVERLAY. Syncsort doesn't.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Wed Mar 08, 2006 1:35 am    Post subject: Reply with quote

When I tried with the JCL given by Kolusu i am getting a Error
like OUTREC - SHORT RECORD The Message is Below.



Code:

  SORT FIELDS=COPY                                                         
  OUTREC FIELDS=(0001,0075,                                               
                 0076:1,3,CHANGE=(05,C'CTS',C'GU   '),                     
                                  NOMATCH=(076,05),                       
                 0081:1,3,CHANGE=(60,C'CTS',                               
  C'                                                            '),       
                                  NOMATCH=(081,60),                       
                 0141:1,3,CHANGE=(06,C'CTS',C'R8401 '),                   
                                  NOMATCH=(141,06),                       
                                   0147,1895)                             
WER164B  8,960K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,         
WER164B     0 BYTES RESERVE REQUESTED, 3,521K BYTES USED                   
WER146B  4K BYTES OF EMERGENCY SPACE ALLOCATED                             
WER108I  SORTIN   :  RECFM=V    ; LRECL=  2041; CISIZE =  4096             
WER237I  OUTREC RECORD LENGTH =  2041                                     
WER110I  SORTOUT  :  RECFM=V    ; LRECL=  2041; CISIZE =  4096             
WER410B  5,884K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,   
WER410B     0 BYTES RESERVE REQUESTED, 456K BYTES USED                     
WER244A  OUTREC - SHORT RECORD                                             


The Verified for this Error and Frank in one forum says the one are more variable length record not of that much length (0147,1895) , so i tried to different lengths.

Like (0147,300) - same error message its giving
(0147,100) - Vsam logical error if i give the sort card like this.


The Input file's MAX length is = 2041 , AVg reclength = 100
I defined a Output VSAM file with the same attributes of Input file.
I tried with the flat output file also , but i am getting the same error message.
Back to top
View user's profile Send private message
Ravi
Beginner


Joined: 27 Jun 2005
Posts: 88
Topics: 2

PostPosted: Wed Mar 08, 2006 2:39 am    Post subject: Reply with quote

mainframemouli,

I tried the same code and it worked.

Give your SORTIN and SORTOUT VSAM files with
Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=USERID.TEMP.VSAM.KSDS,DISP=SHR                     
//SORTOUT  DD DSN=USERID.TEMP.VSA1.KSDS,DISP=OLD                     
//SYSIN DD *                                                         
  SORT FIELDS=COPY                                                   
  OUTREC FIELDS=(0001,0075,                                         
                 0076:1,3,CHANGE=(05,C'CTS',C'GU   '),               
                                  NOMATCH=(076,05),                 
                 0081:1,3,CHANGE=(60,C'CTS',                         
  C'                                                            '), 
                                  NOMATCH=(081,60),                 
                 0141:1,3,CHANGE=(06,C'CTS',C'R8401 '),             
                                  NOMATCH=(141,06),                 
                                   0147,1895)                       
/*

SYSOUT:
----------
WER108I  SORTIN   :  RECFM=V    ; LRECL=  2041; CISIZE =  2048     
WER237I  OUTREC RECORD LENGTH =  2041                             
WER110I  SORTOUT  :  RECFM=V    ; LRECL=  2041; CISIZE =  2048     
WER054I  RCD IN          4, OUT          4                         
WER169I  RELEASE 1.1C BATCH 0397 TPF LEVEL 3A                     
WER052I  END SYNCSORT - USERIDX,STEP0100,,DIAG=8800,CACE,A08A,206C,C066,6CC2,2288,0C66   

mY USERID.TEMP.VSAM.KSDS AND USERID.TEMP.VSA1.KSDS are having
KEYLEN----------------56     AVGLRECL-------------100
RKP--------------------0     MAXLRECL------------2041
 


What is your SORTIN LRECL?? In your first post you mentioned
Quote:
The Input file is VSAM File with AVg.rec length as 100 and Max.Reclength as 2315
where as the SYSOUT is showing 2041
Back to top
View user's profile Send private message
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Wed Mar 08, 2006 3:02 am    Post subject: Reply with quote

The Max Rec length is 2041 only , I metioned Wrongly that time....

I am also trying the same , but i am not getting.
The Output VSAM file defined with the same attribute as input file.

Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=Input vsam file,                             
//            DISP=SHR                                             
//SORTOUT  DD DSN=output vsam file,                           
//            DISP=OLD                                             
//SYSIN DD *                                                       
  SORT FIELDS=COPY                                                 
  OUTREC FIELDS=(0001,0075,                                       
                 0076:1,3,CHANGE=(05,C'CTS',C'GU   '),             
                                  NOMATCH=(076,05),               
                 0081:1,3,CHANGE=(60,C'CTS',                       
  C'                                                            '),
                                  NOMATCH=(081,60),               
                 0141:1,3,CHANGE=(06,C'CTS',C'R8401 '),           
                                  NOMATCH=(141,06),               
                                   0147,1895)                     
/*
//



What might have went wrong here ?????????????


Code:

WER146B  4K BYTES OF EMERGENCY SPACE ALLOCATED                         
WER108I  SORTIN   :  RECFM=V    ; LRECL=  2041; CISIZE =  4096         
WER237I  OUTREC RECORD LENGTH =  2041                                   
WER110I  SORTOUT  :  RECFM=V    ; LRECL=  2041; CISIZE =  4096         
WER410B  5,884K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B     0 BYTES RESERVE REQUESTED, 456K BYTES USED                 
WER244A  OUTREC - SHORT RECORD                                         
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                           
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                           
Back to top
View user's profile Send private message
Ravi
Beginner


Joined: 27 Jun 2005
Posts: 88
Topics: 2

PostPosted: Wed Mar 08, 2006 3:28 am    Post subject: Reply with quote

The problem is with the data. Atleast one record is having wrong data in your VSAM file
Code:

----------- V=SYNCSORT P=SYNCSORT UTIL. Z/OS R=V1R1 I=WER244A D=M ------------
****************** Text Below Copyright (c) 2006, SYNCSORT *******************
WER244A .ddname. {INREC,OUTREC} SHORT RECORD                                   
                                                                               
   EXPLANATION: The ddname will be SORTOUT, SORTOFxx,                         
   SORTOFx or the ddname provided by an OUTFIL FNAMES parameter.               
   A variable-length record was too short to contain all the fields           
   specified on the control statement. Program HISTOGRM may be used to         
   determine the length of the shortest record in the input file.             
****************************** BOTTOM OF DATA ********************************


Try using HISTOGRM.
Code:
 ------------ V=SYNCSORT P=SYNCSORT FOR Z/OS R=V1R1 I=HISTOGRM D=M ------------
 ****************** Text Below Copyright (c) 2006, SYNCSORT *******************
 HISTOGRM Utility Program                                                       
                                                                               
 You may page down or use the FIND command to scroll to the following           
 subtopics:                                                                     
                                                                               
   What Is HISTOGRM?                                                           
   Using HISTOGRM to Determine L6 and L7 Values for SyncSort                   
   Control Parameters for HISTOGRM                                             
   Job Control Language                                                         
   Executing HISTOGRM through an E15 Exit                                       
   HISTOGRM Messages                                                           
                                                                               
 What Is HISTOGRM?                                                             
                                                                               
 HISTOGRM is a separate program which is used to gain information about         
 variable-length files. The program scans a variable-length file and provides   
 information which can then be used to run more efficient sorts. HISTOGRM can   
 report the:                                                                   
                                                                               
 o Block count for minimum and maximum block lengths                           
                                                                               
 o Record count for minimum and maximum record lengths                         
                                                                               
 o Average record length                                                       
                                                                               
 o Total number of bytes in the file                                           
                                                                               
 o Total number of blocks in the file                                           
                                                                               
 o L6 value (average work space) for variable-length records                   
                                                                               
 o L7 value (segment length) for variable-length records                       
                                                                               
 HISTOGRM can be used to analyze variable-length records in a VSAM             
 entry-sequenced or key-sequenced data set. When HISTOGRM processes a VSAM     
 file only record information is gathered; block statistics are not produced.   
                                                                               
 Using HISTOGRM to Determine L6 and L7 Values for SyncSort                     
                                                                               
 The L6 and L7 values HISTOGRM calculates are passed to SyncSort via the L6,   
 L7 PARM options or the l6, l7 values in the LENGTH parameter of the RECORD     
 control statement. (When there is a conflict, the PARM specification takes     
 precedence.) These values are ignored in a merge or copy application.         
                                                                               
 Control Parameters for HISTOGRM                                               
                                                                               
 The control parameters are outlined below; defaults are underlined. To         
 specify other values, include a control statement in the SYSIN DD portion     
 of the job control stream. Parameters may appear anywhere through column       
 71, provided they are separated by commas with no intervening blanks.         
                                                                               
 NRECS                                                                         
                                                                               
           { ALL }                                                             
     NRECS={ --- }                                                             
           { nnn }                                                             
 Tells how many records to scan in the variable-length file.                   
                                                                               
 WIDTH                                                                         
                                                                               
           { 20   }                                                             
     WIDTH={ --   }                                                             
           { nnnn }                                                             
                                                                               
 Indicates the range between minimum and maximum block lengths and the         
 minimum and maximum record lengths in each group of the HISTOGRM output. The   
 number specified for the WIDTH value must be a multiple of 4. (4, 8, 12, . . .
 See examples of block and record HISTOGRMs that follow.) Adjust this range     
 based on the characteristics of the file (the lengths of the shortest and     
 longest record) and the desired length of HISTOGRM.                           
                                                                               
 DEVWK                                                                         
                                                                               
                 { 2311 }                                                       
                 { 3330 }                                                       
                 { 3340 }                                                       
           DEVWK={ 3350 }                                                       
                 { 3375 }                                                       
                 { 3380 }                                                       
                 { 3390 }                                                       
                   ----                                                         
                                                                               
 Tells the type of disk device that will be used for intermediate storage       
 when the sort is run. Specify the device number if HISTOGRM is to calculate   
 L6 and L7.                                                                     
                                                                               
 KEYL                                                                           
                                                                               
             { 20   }                                                           
        KEYL={ --   }                                                           
             { nnnn }                                                           
                                                                               
 Gives the end location of the last control field in the record. Specify a     
 value for KEYL if HISTOGRM is to calculate L6 and L7.                         
                                                                               
 BIGREC                                                                         
                                                                               
                      { 20   }                                                 
                      { --   }                                                 
               BIGREC={ nnnn }                                                 
                      { MAX  }                                                 
                      { MAX  }                                                 
                                                                               
 Specifies the maximum number of HIS025I messages that will be issued in a     
 HISTOGRM execution. When HISTOGRM processes a large file, this message may     
 be generated as often as once for each record in the file. BIGREC limits the   
 number of HIS025I messages that will be issued in each execution. HISTOGRM     
 processing continues, but no further messages are issued once the BIGREC       
 value is reached.                                                             
                                                                               
 BLOCK                                                                         
                                                                               
           { BLOCK   }                                                         
           { -----   }                                                         
           { NOBLOCK }                                                         
                                                                               
 Tells whether or not to print the graphic portion of the HISTOGRM for block   
 length.                                                                       
                                                                               
 REC                                                                           
                                                                               
      { REC   }                                                                 
      { ---   }                                                                 
      { NOREC }                                                                 
                                                                               
 Tells whether or not to print the graphic portion of the HISTOGRM for record   
 length.                                                                       
                                                                               
 BIGSTOP                                                                       
                                                                               
               { BIGSTOP  }                                                     
               { -------  }                                                     
               { NOBIGSTP }                                                     
                                                                               
 Tells whether or not to terminate the HISTOGRM run if an RDW value greater     
 than the DCB LRECL is encountered in the input file.                           
                                                                               
 Job Control Language                                                           
                                                                               
 The following example shows a sample execution of HISTOGRM.                   
                                                                               
 1. SYSUT1 is the variable-length file to be scanned. Specify the DCB           
 parameter if                                                                   
                                                                               
    //L6L7 JOB                                                                 
    //STEP1    EXEC PGM=HISTOGRM                                               
    //STEPLIB  DD DSN=HISTOGRM,DISP=SHR                                         
    //SYSUT1   DD UNIT=3490,VOL=SER=000001,                     1               
    //            DSN=VLRECS,LABEL=(1,SL),                                     
                  DISP=OLD                                                     
    //SYSPRINT DD SYSOUT=A                                      2               
    //SYSIN    DD *                                             3               
          KEYL=50,DEVWK=3390,NOBLOCK,NOBIGSTP                                   
    /*                                                                         
                                                                               
            Figure 232. Sample JCL/Control Stream for HISTOGRM                 
                                                                               
     SYSUT1 is a non-standard label tape.                                       
                                                                               
 2. SYSPRINT is the data set on which printed output will appear. The DCB       
     (not illustrated) is: DCB=(LRECL=121,BLKSIZE=121,RECFM=F).                 
                                                                               
 3. You may use DD DUMMY instead of SYSIN DD *. Specify //SYSIN DD             
     DUMMY,DCB=(LRECL=80,RECFM=FB,BLKSIZE=80).                                 
                                                                               
 Executing HISTOGRM through an E15 Exit                                         
                                                                               
 It is possible to execute HISTOGRM during a sort by specifying an E15 exit     
 in the MODS control statement and coding HISTE15 as the r value. This         
 produces a printout of the HISTOGRM for Records at the conclusion of the       
 job. (It is, however, not possible to get a printout of the HISTOGRM for       
 Blocks when initiating HISTOGRM in this way.)                                 
                                                                               
 The following example shows a sample execution of HISTOGRM by an E15 exit     
 during a sort.                                                                 
                                                                               
 //HISTSORT JOB                                                                 
 //STEP2    EXEC PGM=SYNCSORT                                                   
 //SORTIN   DD UNIT=3490,VOL=SER=000001,                     1                 
 //            DSN=VARDATA,LABEL=(1,SL),                                       
 //            DISP=OLD                                                         
 //SORTOUT  DD UNIT=3490,VOL=SER=000002,                     2                 
 //            DSN=SORTED.DATA,LABEL=(1,SL),                                   
 //            DISP=(,KEEP)                                                     
 //SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(20,10)) 3                                 
 //SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(20,10))                                   
 //SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(20,10))                                   
 //SYSOUT   DD SYSOUT=A                                      4                 
 //MODLIB   DD DSN=SYS1.SYNCLIB,DISP=SHR                     5                 
 //SYSIN    DD *                                             6                 
     SORT FIELDS=(4,10,CH,A)                                                   
     MODS   E15=(HISTE15,7400,MODLIB,N)                      7                 
 //SYSPRINT DD SYSOUT=A                                      8                 
 //HISTIN   DD *                                             9                 
   WIDTH=40                                                                     
 /*                                                                             
                                                                               
    Figure 233. Sample JCL/Control Stream for HISTOGRM Initiated by an         
                E15 Exit                                                       
                                                                               
 1. SORTIN is a DD statement for SyncSort. It contains the data set that will   
     be analyzed and then sorted. The data set name is VARDATA, and it is       
     found on the standard labeled tape with the volume serial number 000001.   
     The data set is already in existence. If SORTIN is not a standard label   
     tape, DCB parameters must be specified. Note that RECFM must be either     
     V, VB, or VBS.                                                             
                                                                               
                E15 Exit                                                       
                                                                               
 1. SORTIN is a DD statement for SyncSort. It contains the data set that will   
     be analyzed and then sorted. The data set name is VARDATA, and it is       
     found on the standard labeled tape with the volume serial number 000001.   
     The data set is already in existence. If SORTIN is not a standard label   
     tape, DCB parameters must be specified. Note that RECFM must be either     
     V, VB, or VBS.                                                             
                                                                               
 2. SORTOUT is a DD statement for SyncSort. It assigns the data set name       
     SORTED.DATA to the output file, and specifies a 3490 tape unit with the   
     volume serial number 000002. It is not yet in existence. The DCB           
     parameters default to those of SORTIN.                                     
                                                                               
 3. SORTWK01, SORTWK02, and SORTWK03 are DD statements for SyncSort. They       
     reserve 20 cylinders of primary space, 10 cylinders of secondary space     
     on direct access devices for intermediate storage.                         
                                                                               
 4. SYSOUT is a DD statement for SyncSort. It assigns the SyncSort messages     
    to the output device associated with class A.                               
                                                                               
 5. The MODLIB DD statement is used to define the partitioned data set in       
     which the HISTE15 program resides; MODLIB is referenced in the MODS       
     control statement. The data set name is SYS1.SYNCLIB, and the DISP shows   
     the library may be shared.                                                 
                                                                               
 6. The SYSIN DD * statement marks the beginning of the input stream that       
      includes the sort control statements. The SORT control statement shows   
      that one control field will be sorted on. It consists of bytes 4-13 of   
      the record, contains character data, and is to be sorted in ascending     
      order.                                                                   
                                                                               
 The MODS control statement must specify an E15 exit as an exit-type           
 parameter and give HISTE15 as the exit routine name. HISTE15 takes 5000       
 bytes of core storage and resides in the main SyncSort library referenced     
 here by a DD statement named MODLIB. The routine does not require             
 link-editing during sort execution.                                           
 7. SYSPRINT is the data set on which the printout from HISTE15 appears. Its   
    DCB is: DCB=(LRECL=121,BLKSIZE=121,RECFM=F).                               
                                                                               
 8. The HISTIN DD statement is optional. It is used to override any default     
      values. The following DCB parameter must be specified:                   
      DCB=(LRECL=80,RECFM= FB,BLKSIZE=80). (With HISTIN DD *, the DCB is not   
      necessary.)                                                               
                                                                               
 Defaults for HISTE15                                                           
                                                                               
 NRECS=                ALL                                                     
                                                                               
 WIDTH=                20                                                       
                                                                               
 DEVWK=                The same SORTWK devices used in executing this sort.     
                                                                               
 KEYL=                 End of key field furthest into record for this sort.     
                                                                               
 BIGREC=               0 (This cannot be overridden.)                           
                                                                               
 NOBLOCK               (This cannot be overridden.)                             
                                                                               
 REC                                                                           
                                                                               
 NOBIGSTP              (This cannot be overridden.)                             
 ****************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Wed Mar 08, 2006 6:25 am    Post subject: Reply with quote

Try this,

For VB files you don't need to specify the length at the end.
Code:

//SYSIN DD *                                                       
  SORT FIELDS=COPY                                                 
  OUTREC FIELDS=(0001,0075,                                         
                 0076:1,3,CHANGE=(05,C'CTS',C'AAAAA'),             
                                  NOMATCH=(076,05),                 
                 0081:1,3,CHANGE=(60,C'CTS',                       
  C'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'),
                                  NOMATCH=(081,60),                 
                 0141:1,3,CHANGE=(06,C'CTS',C'CCCCCC'),             
                                  NOMATCH=(141,06),                 
                 0147)                                         
/*

Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Wed Mar 08, 2006 8:16 am    Post subject: Reply with quote

Yes, I tried that One also kolusu.
Its not working.

As ravi pointed out , Some of the Records are very short that misses the
conditions in the sort controls.

but in this same Forum , there you mentioned for a simillar situation to use
PARM='VLTESTI=1' and PARM='VLTESTI=2'
I have to try those options.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Wed Mar 08, 2006 8:43 am    Post subject: Reply with quote

Quote:

but in this same Forum , there you mentioned for a simillar situation to use
PARM='VLTESTI=1' and PARM='VLTESTI=2'


VLITESTI parm is ONLY applicable to INCLUDE and OMIT control statements. So it won't be much of an use . Run this job to find out the min and max length record

Code:

//STEP0100  EXEC PGM=HISTOGRM
//SYSUT1    DD DSN=Your VB input file,DISP=SHR
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
 NOREC,NOBLOCK
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group