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

Dynamic sort card creation


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

New User


Joined: 26 Nov 2007
Posts: 5
Location: chennai India

PostPosted: Mon Nov 26, 2007 3:23 pm
Reply with quote

Hi,

I have to use the following sort card in my procedure/jcl

Code:

  SORT FIELDS=(52,4,CH,A)                                         
  INCLUDE COND=((1,4,CH,EQ,C'FCFP'),AND,                           
              (86,2,CH,NE,C'01'),AND,                           
              (49,1,CH,NE,C'1'),AND,                             
              (5,30,CH,NE,C'TABLE-IND                     '),AND,
              (5,30,CH,NE,C'WORK-TBL-NO                   '))   
  OUTREC FIELDS=(1:1,1,C' ',3:2,3,C' CFP-',11:5,30,C' ',42:45,4,   
               C' ',47:49,1,C' ',49:50,1,C' ',51:51,1,C' ',     
               53:86,2,C' ',56:88,4,21X)       


In the INCLUDE COND the file 'FCFP' is dynamic, there are about 144 values to be passed replacing 'FCFP'. Also in the OUTREC FIELDS the value 'CFP-' is also dynamic and it it should be the last three characters of INCLUDE COND- 'FCFP'.

How to create dynamic sort card for this ?
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: Mon Nov 26, 2007 11:38 pm
Reply with quote

Quote:
In the INCLUDE COND the file 'FCFP' is dynamic, there are about 144 values to be passed replacing 'FCFP'.


Where does the specific value of the 144 possible values for a run come from? Do you have it another file? Or do you want to hardcode it, or what?

If you just want to hardcode it, then you can use DFSORT symbols:

Code:

//SYMNAMES DD *
TARG1,'FCFP'
TARG2,' CFP-'
...
//SYSIN DD *
  SORT FIELDS=(52,4,CH,A)                                         
  INCLUDE COND=((1,4,CH,EQ,TARG1),AND,                           
              (86,2,CH,NE,C'01'),AND,                           
              (49,1,CH,NE,C'1'),AND,                             
              (5,30,CH,NE,C'TABLE-IND'),AND,
              (5,30,CH,NE,C'WORK-TBL-NO'))   
  OUTREC FIELDS=(1:1,1,C' ',3:2,3,TARG2,11:5,30,C' ',42:45,4,   
               C' ',47:49,1,C' ',49:50,1,C' ',51:51,1,C' ',     
               53:86,2,C' ',56:88,4,21X)       


If you want to do something else, you need to explain exactly what you want to do.

Note that you don't need the trailing blanks in the 5,30,CH constants ... DFSORT will pad the constant with trailing blanks to match the length of the field (30).
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Tue Nov 27, 2007 11:45 am
Reply with quote

Hi Frank,

How can we pass those different values from file
Back to top
View user's profile Send private message
arunkumar p

New User


Joined: 26 Nov 2007
Posts: 5
Location: chennai India

PostPosted: Tue Nov 27, 2007 8:49 pm
Reply with quote

Hi Frank,

Thank you for your reply!

The sort step i mentioned earlier is being used in a jcl. The jcl will in turn execute the proc which excutes a code generator batch program.

The output is 144 batch programs. Now im running the jcl each time for 144 files in the view mode by giving overrides.

The batch program will use a parameter file. For 144 parameter iam using override technique.

Also in,

OUTREC FIELDS=(1:1,1,C' ',3:2,3,C' CFP-',11:5,30,C' ',42:45,4,
C' ',47:49,1,C' ',49:50,1,C' ',51:51,1,C' ',
53:86,2,C' ',56:88,4,21X)

The 'CFP- ' is the string value that should be prefixed in certain variables in the batch program created by the code generator program.

For FCFP parameter value CFP- is prefixed in output records
For FACT parameter value ACT- is prefixed in ouput records

and so on for the rest of the 144 values.

I dont want to harcode the values. Also iam using ICEMAN for sorting.

Kindly give your suggestions.
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: Tue Nov 27, 2007 11:12 pm
Reply with quote

You still haven't made it clear where the value for the run comes from.

You say
Quote:
The batch program will use a parameter file.


Does that mean that the "value" is in another file? If so, what is the RECFM and LRECL of that file? What does the record (or records) in that file look like? Where is the value in that file? Give an example.

If the value is NOT in another file, then where is it exactly? Give an example.
Back to top
View user's profile Send private message
arunkumar p

New User


Joined: 26 Nov 2007
Posts: 5
Location: chennai India

PostPosted: Wed Nov 28, 2007 3:44 pm
Reply with quote

Hi Frank,

I had provided the JCL and PROC i am using

Code:

Jcl:

//SORTA    EXEC PGM=ICEMAN                 
//SORTLIB  DD   DSN=SYS1.SORTLIB,DISP=SHR   
//SYSOUT   DD   SYSOUT=*                   
//SORTA    EXEC PGM=ICEMAN                                             
//SORTLIB  DD   DSN=SYS1.SORTLIB,DISP=SHR                               
//SYSOUT   DD   SYSOUT=*                                               
//SYSUDUMP DD   SYSOUT=*                                               
//SYSDBOUT DD   SYSOUT=*                                               
//SORTIN   DD   DSN=LAVANYA.FAMIS51.UT.PMMELE,                         
//          DISP=SHR                                                   
//SORTOUT  DD   DSN=&&TEMP,                                             
//            DISP=(NEW,PASS),UNIT=SYSDA,                               
//            SPACE=(CYL,(15,12),RLSE),                                 
//            DCB=(RECFM=FB,LRECL=80)                                   
//SYSIN DD *                                                           
      SORT FIELDS=(52,4,CH,A)                                           
      INCLUDE COND=((1,4,CH,EQ,C'FCFP'),AND,                           
                    (86,2,CH,NE,C'01'),AND,                             
                    (49,1,CH,NE,C'1'),AND,                             
                    (5,30,CH,NE,C'TABLE-IND'),AND,
                    (5,30,CH,NE,C'WORK-TBL-NO'))     
       OUTREC FIELDS=(1:1,1,C' ',3:2,3,C' CFP-',11:5,30,C' ',42:45,4,   
                      C' ',47:49,1,C' ',49:50,1,C' ',51:51,1,C' ',       
                      53:86,2,C' ',56:88,4,21X)                         
 /*                                                                     
 //FAMTCFP EXEC  FAMCBPRC,MEM='SQLBC002',VER='FAMIS51.UT',               
 //           HLQ='KPMG.FAMIS51.UT'                                     
 //FAMCBPRC.PARMIN DD *                                                 
 FCFP                                                                   
 //*                                                 
-------------------------------------------------------------------------------------
Proc:


//FAMCBPRC PROC                                                         
//*                                                                     
//FAMCBPRC EXEC PGM=&MEM,DYNAMNBR=20                                   
//STEPLIB  INCLUDE MEMBER=STEPLIB                                       
//SYSTSPRT DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//INPFIL   DD DSN=&VER..PROCLIB(FAMTCPGM),DISP=SHR                     
//*******************************************************************   
//*          DATAFL HAS THE LIST OF FIELDS IN THE VSAM FILE         *   
//*******************************************************************   
//DATAFL   DD DUMMY                                                     
//PMMREC   DD DSN=&HLQ..PMMREC,DISP=SHR                                 
//PMMELE   DD DSN=&HLQ..PMMELE,DISP=SHR                                 
//OUTFIL   DD DSN=&VER..VSAM2SQL.BSRCELIB,DISP=(MOD,CATLG,DELETE)       
//*******************************************************************   
  //*PARMIN HAS THE VSAM FILE FOR WHICH DOWNLOAD PROGRAM NEEDS TO BE  *
//*                            GENERATED                            *
//*******************************************************************
//PARMIN   DD DUMMY                                                   
//SYSUDUMP DD SYSOUT=*                                               
//*                                                                   



The value i mentioned will be in parm file. There will be only one parm file and one value in the parm file. EX: FCFP .
We want to run the jcl for about 144 values one by one by giving override in jcl. please refer the JCL.

The RECFM is Fixed and LRECL is 80

Kindly give your suggestion.
Back to top
View user's profile Send private message
arunkumar p

New User


Joined: 26 Nov 2007
Posts: 5
Location: chennai India

PostPosted: Wed Nov 28, 2007 3:48 pm
Reply with quote

Note: Sorry! The parm file is DUMMY. I missed out that!!!!!!
Back to top
View user's profile Send private message
arunkumar p

New User


Joined: 26 Nov 2007
Posts: 5
Location: chennai India

PostPosted: Wed Nov 28, 2007 4:05 pm
Reply with quote

Frank,

Can i create a cobol program which generates the following sord card as output file ? so that it can be used in jcl ? will this idea work out?

SORT FIELDS=(52,4,CH,A)
INCLUDE COND=((1,4,CH,EQ,C'FCFP'),AND,
(86,2,CH,NE,C'01'),AND,
(49,1,CH,NE,C'1'),AND,
(5,30,CH,NE,C'TABLE-IND'),AND,
(5,30,CH,NE,C'WORK-TBL-NO'))
OUTREC FIELDS=(1:1,1,C' ',3:2,3,C' CFP-',11:5,30,C' ',42:45,4,
C' ',47:49,1,C' ',49:50,1,C' ',51:51,1,C' ',
53:86,2,C' ',56:88,4,21X)

whats your suggestion ?
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: Wed Nov 28, 2007 8:35 pm
Reply with quote

Hello,

Quote:
Can i create a cobol program which generates the following sord card as output file ? so that it can be used in jcl ? will this idea work out?
Yes, you can and it will work.

It just depends on if you are restricted to using "jcl" only.
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: Wed Nov 28, 2007 10:28 pm
Reply with quote

My idea was to use DFSORT to create DFSORT Symbols from the value (abcd) in the PARM file and then use those DFSORT Symbols in your control statements:

Sym1,'abcd'
Sym2,'bcd-'

Code:

 SORT FIELDS=(52,4,CH,A)                                         
  INCLUDE COND=((1,4,CH,EQ,Sym1),AND,                           
              (86,2,CH,NE,C'01'),AND,                           
              (49,1,CH,NE,C'1'),AND,                             
              (5,30,CH,NE,C'TABLE-IND                     '),AND,
              (5,30,CH,NE,C'WORK-TBL-NO                   '))   
  OUTREC FIELDS=(1:1,1,C' ',3:2,3,Sym2,11:5,30,C' ',42:45,4,   
               C' ',47:49,1,C' ',49:50,1,C' ',51:51,1,C' ',     
               53:86,2,C' ',56:88,4,21X)     


But you would have to make the value available in a data set and I don't understand if or how:

//FAMCBPRC.PARMIN DD *
FCFP
//*

would be accessible to a DFSORT step that runs before your other DFSORT step. (But then my PROC skills are minimal.)

You can generate DFSORT statements from a COBOL program and use them for SYSIN - just be sure the SYSIN data set has RECFM=FB and LRECL=80.
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

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top