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 

how to select the latest PS file
Goto page Previous  1, 2
 
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
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jul 08, 2010 10:37 am    Post subject: Reply with quote

shyamsaravan,

bonk why are you having different qualifiers for the dataset names? in the first post you showed all of them to be the same HLQ and all you need to pick the latest version. Btw I get a return code of zero for the job if I use the data as instream data. Show me the JESJCL sysout from the job. which will show the error you are having. What is the LRECL and RECFM of the input file?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shyamsaravan
Beginner


Joined: 12 May 2010
Posts: 44
Topics: 12
Location: India

PostPosted: Fri Jul 09, 2010 6:22 am    Post subject: Reply with quote

Our internal program creates the output file and send to the inbuilt mailbox,The mailbox generates the below files periodically

My requirement is the new jcl directly has to check which is the highest last qualifier file and need to copy all the records to another output file(LRECL=88,RECFM=FB)
Input file also has same DCB,like (LRECL=88,RECFM=FB)

So,we dont know which one is the highest last qualifier file while the New JCL runs,so that we cant give the correct input file in the SORTIN.The system has to fetch the highest last qualifier file directly to the SORTIN

My mailbox has the below files
NORTHWEST is a mailbox name
Code:

UC.WD.MAIL.INCO.NORTHWEST.N3202
UC.WD.MAIL.INCO.NORTHWEST.N3203
UC.WD.MAIL.INCO.NORTHWEST.N3204
UC.WD.MAIL.INCO.NORTHWEST.N3205
UC.WD.MAIL.INCO.NORTHWEST.N3206
UC.WD.MAIL.INCO.NORTHWEST.N3207
UC.WD.MAIL.INCO.NORTHWEST.N3208
UC.WD.MAIL.INCO.NORTHWEST.N3209
UC.WD.MAIL.INCO.NORTHWEST.N3210
UC.WD.MAIL.INCO.NORTHWEST.N3211
UC.WD.MAIL.INCO.NORTHWEST.N3212
UC.WD.MAIL.INCO.NORTHWEST.N3213


JCL is
Code:

//OAZA7PS JOB (W100Q82S,WES-00),'SAMP',CLASS=T,MSGCLASS=Z,     
//             REGION=4096K,NOTIFY=&SYSUID                     
//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=UC.WD.MAIL.INCO.NORTHWEST.N3213,DISP=SHR           
//SORTOUT  DD SYSOUT=(*,INTRDR)                               
//SYSIN    DD *                                               
        SORT FIELDS=(1,44,CH,D)                               
         OUTFIL ENDREC=1,                                     
         BUILD=(C'//OAZA7PP JOB W100Q82S,''',C'COPY''',C',',/,
            C'//             CLASS=T,',/,                     
            C'//             MSGCLASS=Z,',/,                   
            C'//             MSGLEVEL=(1,1),',/,               
            C'//             NOTIFY=OAZAE34',/,                 
            C'//*',/,                                         
            C'//STEP0100 EXEC  PGM=SORT',/,                   
            C'//SYSOUT   DD SYSOUT=*',/,                       
            C'//SORTIN   DD DISP=SHR,DSN=',1,44,/,             
            C'//SORTOUT  DD DSN=OAZAE34.TEST.COPYOUT,',/,     
            C'//            DISP=(NEW,CATLG,DELETE),',/,       
            C'//            UNIT=SYSDA,',/,                   
            C'//            SPACE=(CYL,(1,1),RLSE)',/,     
            C'//           DCB=(Z.DUMMYDCB,RECFM=FB,LRECL=88,BLKSIZE=1760)',/,
            C'//SYSIN    DD *',/,                             
                     C'  SORT FIELDS=COPY',/,                 
                     C'//*',88:X)             
//*             


First job JESJCL
Code:

1 //OAZA7PS JOB (W100Q82S,WES-00),'SAMP',CLASS=T,MSGCLASS=Z,           
  //             REGION=4096K,NOTIFY=&SYSUID,                           
  //  TIME=(0000,35)   >> TIME PARAMETER HAS BEEN INSERTED BY SYSTEM   
  IEFC653I SUBSTITUTION JCL - (W100Q82S,WES-00),'SAMP',CLASS=T,MSGCLASS=Z,REGION=4096K,NOTIFY=OAZAE34,TIME=(0000,
  35)                                                                   
2 //STEP0100 EXEC PGM=SORT                                             
3 //SYSOUT   DD SYSOUT=*                                               
4 //SORTIN   DD DSN=UC.WD.MAIL.INCO.NORTHWEST.N3213,DISP=SHR                         
5 //SORTOUT  DD SYSOUT=(*,INTRDR)                                       
6 //SYSIN    DD *                                                       
  //*     

SECOND JOB JESJCL                                                             

1 //OAZA7PP JOB W100Q82S,'COPY',                                       
  //             CLASS=T,                                               
  //             MSGCLASS=Z,                                           
  //             MSGLEVEL=(1,1),                                       
  //             NOTIFY=OAZAE34                                         
  //  TIME=(0000,35)   >> TIME PARAMETER HAS BEEN INSERTED BY SYSTEM   
  //*                                                                   
2 //STEP0100 EXEC  PGM=SORT                                             
3 //SYSOUT   DD SYSOUT=*                                               
4 //SORTIN   DD DISP=SHR,DSN=01TRAILER 001116 000015 172748 00000 17280
5 //SORTOUT  DD DSN=OAZAE34.TEST.COPYOUT,                               
  //            DISP=(,CATLG,DELETE),                               
  //            UNIT=SYSDA,                                             
  //            SPACE=(TRK,(15,15),RLSE) ,
 //             DCB=(Z.DUMMYDCB,RECFM=FB,LRECL=88,BLKSIZE=1760)     
                           
6 //SYSIN    DD *                                                       
  //*   


MY JESYSMSG
Code:

 STMT NO. MESSAGE                                                 
-                                                                 
        4 IEF642I EXCESSIVE PARAMETER LENGTH IN THE DSNAME FIELD 


For testing purpose only, entered the latest file in the SORTIN maually for the above JCL
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Jul 09, 2010 7:25 am    Post subject: Reply with quote

UC.WD.MAIL.INCO.NORTHWEST.N3213

each node in a dsn (data set name) can be max 8 char.
max length of a dsn is 44.

NORTHWEST = 9, have to change the name.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
shyamsaravan
Beginner


Joined: 12 May 2010
Posts: 44
Topics: 12
Location: India

PostPosted: Fri Jul 09, 2010 9:04 am    Post subject: Reply with quote

It is a typographical mistake,Please treat as NORTHWES
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Jul 09, 2010 9:17 am    Post subject: Reply with quote

From your second job...

Quote:
DSN=01TRAILER 001116 000015 172748 00000 17280


Your first job worked but you supplied it with the wrong file - it wants the list of dataset names from which you want the first job to pick the latest. You have supplied the latest file and the trailer record has been extracted and inserted into the second job as a dataset name.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Jul 09, 2010 10:32 am    Post subject: Reply with quote

shyamsaravan,

Unless you have a way to distinguish which is the latest file, you are not guaranteed to pick the right file. So you need to find a filed or flag which identifies the latest file.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Jul 09, 2010 1:43 pm    Post subject: Reply with quote

This task is very straight forward using Rexx instead of SORT, especially if you already have the data set names (though getting them in Rexx is only a little code). Rexx is a scripting language and what you are asking for is a script. I'd suggest using the right tool for the task rather than picking the tool and then describing the task.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
shyamsaravan
Beginner


Joined: 12 May 2010
Posts: 44
Topics: 12
Location: India

PostPosted: Mon Jul 12, 2010 9:24 am    Post subject: Reply with quote

Thanks all for the reply,Please guide me any other tricks to get the solution.
Back to top
View user's profile Send private message
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 Previous  1, 2
Page 2 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