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 

Receive multiple files

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Bindaasamit
Beginner


Joined: 13 Apr 2007
Posts: 4
Topics: 1

PostPosted: Wed Nov 11, 2009 7:08 pm    Post subject: Receive multiple files Reply with quote

I have a peculiar problem here.

Overview:
Every day business representatives submit some messages for processing, which are internally directed to come my userid.
From this we understand that the no of messages that I have for my processing are not fixed. (somedays we have 5 somedays 9)

So everyday i do a TSO RECEIVE to receive all the files. The format of the filename is
USERID.RREGEDIT.D091101
USERID.RREGEDIT.D091102
......
USERID.RREGEDIT.D091109
(Notice the last Low level qualifier changes for every message).


Goal :
I want to merge all the files into 1 file which I can then use for my further processing.


Please advise.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


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

PostPosted: Wed Nov 11, 2009 7:12 pm    Post subject: Reply with quote

since you do a tso receive (manual operation),
you know the names of the files,
so just concatenate them for your processing, thus requiring no extra processing.

at worst, you would need to create an INCLUDE file, which then can be used in your standard jcl.
_________________
Dick Brenholtz
American living in Varel, Germany
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 11, 2009 7:55 pm    Post subject: Reply with quote

Bindaasamit,

Use the following DFSORT jcl which will merge all your input datasets into a single dataset as well as delete them if the job ran successfully.

verify the output from step0100 and if everything looks good then , change the following statement

Code:

//SORTOUT  DD SYSOUT=*


to

Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)


Code:

//STEP0050 EXEC PGM=IKJEFT01                                 
//SYSTSPRT DD DSN=&&L,DISP=(,PASS),                         
//            SPACE=(CYL,(15,5),RLSE),                       
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)             
//SYSTSIN  DD *                                             
  LISTCAT LEVEL ('USERID.RREGEDIT') NAMES                   
//*                                                         
//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=&&L,DISP=SHR                               
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
 SORT FIELDS=COPY                                           
 INCLUDE COND=(1,7,CH,EQ,C'NONVSAM')                         
 OUTREC IFOUTLEN=80,                                         
 IFTHEN=(WHEN=INIT,BUILD=(C'//',39X,17,44,86:SEQNUM,8,ZD)), 
 IFTHEN=(WHEN=(86,8,ZD,EQ,1),                               
 OVERLAY=(3:C'SORTIN   DD DISP=(OLD,DELETE,KEEP),DSN=')),   
 IFTHEN=(WHEN=(86,8,ZD,GT,1),                               
 OVERLAY=(12:C'DD DISP=(OLD,DELETE,KEEP),DSN='))             
                                                             
 OUTFIL REMOVECC,                                           
 HEADER1=('//TIDXXXXA JOB ''','COPY''',',',/,               
          '//             CLASS=A,',/,                       
          '//             MSGCLASS=Y,',/,                   
          '//             MSGLEVEL=(1,1),',/,               
          '//             NOTIFY=TID',/,                     
          '//*',/,                                           
          '//STEP0100 EXEC PGM=SORT',/,                     
          '//SYSOUT   DD SYSOUT=*',/,                       
          '//SORTOUT  DD DSN=YOUR.MERGED.OUTPUT,',/,         
          '//            DISP=(NEW,CATLG,DELETE),',/,       
          '//            UNIT=SYSDA,',/,                     
          '//            SPACE=(CYL,(X,Y),RLSE)',/,         
          '//SYSIN    DD *',/,                               
          '  OPTION COPY  ',/,                               
          '//*',80:X)                                       
//*



The output of this job is as follows

Code:

//TIDXXXXA JOB 'COPY',                                         
//             CLASS=A,                                         
//             MSGCLASS=Y,                                     
//             MSGLEVEL=(1,1),                                 
//             NOTIFY=TID                                       
//*                                                             
//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTOUT  DD DSN=YOUR.MERGED.OUTPUT,                           
//            DISP=(NEW,CATLG,DELETE),                         
//            UNIT=SYSDA,                                       
//            SPACE=(CYL,(X,Y),RLSE)                           
//SYSIN    DD *                                                 
  OPTION COPY                                                   
//*                                                             
//SORTIN   DD DISP=(OLD,DELETE,KEEP),DSN=USERID.RREGEDIT.D091101
//         DD DISP=(OLD,DELETE,KEEP),DSN=USERID.RREGEDIT.D091102
//         DD DISP=(OLD,DELETE,KEEP),DSN=USERID.RREGEDIT.D091103
//         DD DISP=(OLD,DELETE,KEEP),DSN=USERID.RREGEDIT.D091104
//         DD DISP=(OLD,DELETE,KEEP),DSN=USERID.RREGEDIT.D091108
//         DD DISP=(OLD,DELETE,KEEP),DSN=USERID.RREGEDIT.D091109

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


Joined: 13 Apr 2007
Posts: 4
Topics: 1

PostPosted: Thu Nov 12, 2009 1:56 pm    Post subject: Reply with quote

Thanks a lot for your quick help on the info.

My Query is :
We create only the jcl in the sysout(we can also direct it to a dataset).
Can we execute this "created" jcl in one of the steps of the main jcl and then in the next step execute the main process.

Can I put a condition code on the main process so that it executes only when the created jcl executes successfully.

Thanks in advance.
[/u]
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Nov 12, 2009 2:11 pm    Post subject: Reply with quote

The created JCL cannot execute in the same job that creates it. You would need to submit the dataset with the created JCL as a new job thru the INTRDR.

You could append the main job JCL (with COND CODE checking) to the same dataset so it follows the combine step.
Code:
//STEP EXEC PGM=IEBGENER
//SYSUT1 DD DSN=new.jcl,dataset,DISP=SHR  /* with JOB card  */
//       DD DSN=other.main.job.steps,DISP=SHR  /* no JOB card */
//SYSUT2 DD SYSOUT=(A,INTRDR)
//...other dds?

_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
Bindaasamit
Beginner


Joined: 13 Apr 2007
Posts: 4
Topics: 1

PostPosted: Thu Nov 12, 2009 2:55 pm    Post subject: Reply with quote

If I cannot execute the created jcl in the same jcl as the one creating it then
I will need 3 jcls..

1. Jcl which creates the sort jcl
2. Jcl to execute the sort jcl
3. Jcl to execute the main jcl

Can I merge the 2nd & 3rd jcls such that
the 1st step of my 3rd jcl does not start if
the sort jcl executed in Jcl-2 does not execute successfully!

Thanks again 4 your patience!
Back to top
View user's profile Send private message
Bindaasamit
Beginner


Joined: 13 Apr 2007
Posts: 4
Topics: 1

PostPosted: Thu Nov 12, 2009 2:56 pm    Post subject: Reply with quote

let me be clear here.
Jcl 3 to execute the " MAIN PROCESS" is what I meant
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Thu Nov 12, 2009 11:24 pm    Post subject: Reply with quote

You should be able to do what you want with 2 processes.

One to generate the remainder (step 2 and step 3) of the jcl including a COND test to bypass the 3rd step if there is a problem with step 2.
_________________
All the best,

di
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: Fri Nov 13, 2009 11:12 am    Post subject: Reply with quote

Bindaasamit,

*sigh* you don't need 2 steps in the first place , I showed you an example to merge the datasets into a single file as your initial post only mentions that. You can change that to your main process which will have all the datasets concatenated to the ddname the program reads.

Show me the JCL which you use to run the main process and I will show you how to do it.
_________________
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 -> TSO and ISPF 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