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 

NDM Query.

 
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
heman
Beginner


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Wed Aug 17, 2005 7:13 am    Post subject: NDM Query. Reply with quote

Hi all,

This is my first posting on this forum. Smile

I have a NDM job which will move a file from one region to another.

//SYSIN DD *
SIGNON
SUBMIT PROC=NDMRNJOB -
PNODE=Region1 -
SNODE=Region2 -
&PROCESS=TESTNDM -
NEWNAME=&PROCESS -
&INDSN=xxx.yyy.zzz -
&OUTDSN=aaa.bbb.ccc -
&OUTDISP=(NEW,CATLG,DELETE)
SIGNOFF

/*

Now the file xxx.yyy.zzz contains an information in its header record, say a sequence number. This sequence number will vary on daily basis. The sequence number is to be extracted from the INDSN file and is to be plugged in the name of the OUTDSN file name ie. aaa.bbb.ccc.seqno before we do the NDM.
We can extract the sequence number from the input file but how can we pass the same to the output filename before doing the NDM. This needs to be done in the same job by adding steps prior to the NDM.
It will be great if someone can provide the complete steps for this.

Thanks in advance,
Heman.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Aug 17, 2005 7:41 am    Post subject: Reply with quote

I'm not sure I'm following what you are asking for. You say that you already can extract the sequence number from the input file. Can't the same process create the required control record:
Code:

&OUTDSN=aaa.bbb.ccc.seqno -


into a temporary dataset and pass that dataset as one of the inputs to the DMBATCH step?
Code:

//SYSIN DD *
SIGNON
  SUBMIT PROC=NDMRNJOB -
  PNODE=Region1 -
  SNODE=Region2 -
  &PROCESS=TESTNDM -
  NEWNAME=&PROCESS -
  &INDSN=xxx.yyy.zzz -
/*
//      DD DSN=&&TMP,DISP=(OLD,PASS)
//      DD *
  &OUTDISP=(NEW,CATLG,DELETE)
SIGNOFF
/*
Back to top
View user's profile Send private message
heman
Beginner


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Thu Aug 18, 2005 12:34 am    Post subject: Reply with quote

Hi,

Following is the NDM job which I'm required to modify:

//NDMCNT1 EXEC DMBATCH
//DMPUBLIB DD DISP=SHR,DSN=AMCD.EFGH.IJKL.NDM
//SYSIN DD *
SIGNON USERID=(XX) ESF=YES
SUBMIT PROC=NDMJOB -
&INDSN='XXXX.YYYY.ZZZZ' -
&OUTDSN='AAAA.BBBB.CCCC'
SIGNOFF
/*
//


AMCD.EFGH.IJKL.NDM(NDMJOB)

NDMJOB PROCESS -
HOLD=NO -
PNODE=REG1 -
SNODE=REG2 -
PRTY=15
COPYDSN1 COPY FROM (PNODE DSN=&INDSN DISP=SHR) -
TO (SNODE DSN=&OUTDSN DISP=(NEW,CATLG)) -
COMPRESS EXTENDED

Now, I need to plug in the sequence number (which is present in the INDSN file) with the name of the OUTDSN file.
Yup, I can create a control card which will have the sequence number plugged into the OUTDSN filename. This control card will be created in a separate program which is also going to create the INDSN file. The control card will look as follows:

Control card (OFILNAM)

AAAA.BBBB.CCCC.seqno -

say, the control is present in Library FFFF.GGGG.DDDD(OFILNAM)

How do I use this control card containing the OUTDSN file name in my NDM Job mentioned at the top to pass the OUTDSN file name?
Back to top
View user's profile Send private message
heman
Beginner


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Thu Aug 18, 2005 1:32 am    Post subject: Reply with quote

Hi Superk,

Thanks a lot boss. I tried with the way suggested by you and it worked. Thanks once again.

Cheers,
Heman.
Back to top
View user's profile Send private message
heman
Beginner


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Thu Aug 18, 2005 2:39 am    Post subject: Reply with quote

Hi Superk,

The problem is as to how to create the control card.

&OUTDSN=aaa.bbb.ccc.seqno -

The program which creates the input file can only create an additional flat file which will have one record containing the statement required in the control card.

How do I create the control card from this flat file?

Cheers,
Heman.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Aug 18, 2005 8:07 am    Post subject: Reply with quote

Heman,

You can use SORT to create the dynamic control card which reads just the first record from your input file and creates the dynamic file name along with the seqno.

Assuming that your seqno in the input file starts at pos 1 for 5 bytes the following JCL will build the dynamic output file name appending the seqno at the end.

Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
12345                                                 
REC1                                                   
REC2                                                   
REC3                                                   
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
 OPTION STOPAFT=1                                     
 SORT FIELDS=COPY                                     
 OUTFIL OUTREC=(C' SIGNON',/,                         
                C' SUBMIT PROC=NDMRNJOB        -',/,   
                C' PNODE=REGION1               -',/,   
                C' SNODE=REGION2               -',/,   
                C' &PROCESS=TESTNDM            -',/,   
                C' NEWNAME=&PROCESS            -',/,   
                C' &INDSN=XXX.YYY.ZZZ          -',/,   
                C' &OUTDSN=AAA.BBB.CCC.',             
                1,5,                                   
                C'   -',/,                             
                C' &OUTDISP=(NEW,CATLG,DELETE)',/,     
                C' SIGNOFF',80:X)                     
/*                                                     


The output from this step is
Code:

 SIGNON                       
 SUBMIT PROC=NDMRNJOB        -
 PNODE=REGION1               -
 SNODE=REGION2               -
 &PROCESS=TESTNDM            -
 NEWNAME=&PROCESS            -
 &INDSN=XXX.YYY.ZZZ          -
 &OUTDSN=AAA.BBB.CCC.12345   -
 &OUTDISP=(NEW,CATLG,DELETE) 
 SIGNOFF                     


Hope this helps...

Cheers

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


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Aug 18, 2005 8:08 am    Post subject: Reply with quote

I would think a simple SORT step would do what you need:
Code:

//SORTCNTL EXEC PGM=SORT                             
//SORTIN   DD   DISP=SHR,DSN=FFFF.GGGG.DDDD(OFILNAM)
//SORTOUT  DD   DSN=&&TMP,DISP=(,PASS),UNIT=VIO     
//SYSOUT   DD   SYSOUT=*                             
//SYSIN    DD   *                                   
  OPTION COPY                                       
  OUTREC FIELDS=(1:C'&OUTDSN=',1,46,80:X)           
/*                                                   
//*                                                 
//NDMCNT1 EXEC DMBATCH                               
//DMPUBLIB DD   DISP=SHR,DSN=AMCD.EFGH.IJKL.NDM     
//SYSIN  DD   *                                   
SIGNON USERID=(XX) ESF=YES                           
SUBMIT PROC=NDMJOB -                                 
&INDSN='XXXX.YYYY.ZZZZ' -                           
/*                                                   
//         DD   DSN=&&TMP,DISP=(OLD,PASS)           
//         DD   *                                   
SIGNOFF                                             
/*                                                   
//*
Back to top
View user's profile Send private message
heman
Beginner


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Thu Aug 18, 2005 8:16 am    Post subject: Reply with quote

Thanks to both of you. It works and the motive is achieved.
Thanks once again.

Cheers,
Heman.
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
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