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 

Generate Dynamic JCL using DFSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Wed Nov 04, 2009 12:57 pm    Post subject: Generate Dynamic JCL using DFSORT Reply with quote

I have two input files

1. One file with one Empl no of 10 digits (Only 1 Record will be present)
2. Second file with following structure (Many record but unique Empl nos):
Empl no: 9(10)
Dataset name: x(40)

In first step I need to match the Empl no from first file in the second file and get following outputs:
1. Dataset name as an DSN name.
2. Dataset name copied into one file.

In second step I would be running one program for which above input files are required.

For Example:
Input to Step1:
File1: 1234567890
File2: 1234567890NUMD.DATA.REFERRAL.G01V00

Step2 should look like:

//PGM1 EXEC PGM=PGM1
//FILE1 DD DSN=NUMD.DATA.REFERRAL.G01V00,DISP=SHR
//FILE2 DD DSN=TEMPFILE,DISP=SHR

TEMPFILE should have a record with NUMD.DATA.REFERRAL.G01V00 file name.

Please help me to do above scenario through DFSORT if possible.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Nov 04, 2009 1:26 pm    Post subject: Reply with quote

psmadhusudhan,

There are a couple of issues .

1. You do realize that you are generating dynamic JCL and it needs to be submitted as a different job?

2. The dataset name can be a max of 44 characters and you are only having 40 bytes.

3. What happens if you DON't find a match in second file?

4. The tempfile you generated here cannot be used in the dynamic step later. You need to catalog the dataset and then delete it in the dynamic job.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Thu Nov 05, 2009 3:26 am    Post subject: Reply with quote

Kolusu,
Quote:

You do realize that you are generating dynamic JCL and it needs to be submitted as a different job?

Yes I know it is a dynamic JCL.

Quote:

The dataset name can be a max of 44 characters and you are only having 40 bytes.

Even the file name is 40 bytes I dont think there would be any problem.

Quote:

What happens if you DON't find a match in second file?

Match will surey exist.

Is it possible to submit dynamic JCL from another JCL without using cobol program?
Will that help in above scenario or I should write a CObol program.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Nov 05, 2009 11:43 am    Post subject: Reply with quote

psmadhusudhan,

The following DFSORT JCL will generate the dynamic JCL. verify the output from step0200 and if everything looks good then , change the following statement

Code:

//SORTOUT  DD SYSOUT=*


to

Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)



Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=your 1 record emp num file,DISP=SHR     
//SORTOUT  DD DSN=&&S,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE) 
//SYSIN    DD *                                           
  OPTION COPY,STOPAFT=1                                   
  OUTREC BUILD=(C'ACTNUM,C''',1,10,C'''',80:X)             
//*                                                       
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SYMNAMES DD DSN=&&S,DISP=SHR                             
//SORTIN   DD DSN=your filenames file,DISP=SHR             
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  OPTION COPY                                             
  INCLUDE COND=(1,10,CH,EQ,ACTNUM)                         
  OUTFIL REMOVECC,NODETAIL,                               
  HEADER1=('//NEWJOB   JOB ''',C'NEWPGM''',C',',/,         
           '//',13X,C'CLASS=A,',/,                         
           '//',13X,C'MSGCLASS=Y,',/,                     
           '//',13X,C'MSGLEVEL=(1,1),',/,                 
           '//',13X,C'NOTIFY=PMADHU',/,                   
           '//*',/,                                       
           '//STEP0100 EXEC PGM=PGM1',/,                   
           '//SYSOUT   DD SYSOUT=*',/,                     
           '//SYSPRINT DD SYSOUT=*',/,                     
           '//FILE1    DD DISP=SHR,DSN=',11,44,/,         
           '//FILE2    DD *',/,11,44,80:X,/,               
           '//*',80:X)                                     
//*

_________________
Kolusu
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 -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
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