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
 

 

Dynamic sort card creation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Dynamic sort card creation
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Nov 26, 2007 11:38 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Nov 27, 2007 11:12 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Nov 28, 2007 8:35 pm    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Nov 28, 2007 10:28 pm    Post subject:
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    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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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