IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Dynamic file name issue


IBM Mainframe Forums -> FAQ & Basics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Jul 03, 2012 9:02 pm
Reply with quote

Hello,

I am trying to pass a dynamically created file to my application program through JCL as 'DD DSN=ABC.D*.XYZ'

* - can be anything no julian date or any date stamp, I am not supposed to use REXX.

How can i achieve this? Please suggest.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jul 03, 2012 9:08 pm
Reply with quote

Hello,

I probably misunderstand, but one way to do what i believe you want is to put the job in a cataloged PROCedure and make the D* a symbolic parameter to be specified at run time.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Jul 03, 2012 9:36 pm
Reply with quote

As i said D* is dynamic. i will not know the value of D*.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Jul 03, 2012 9:39 pm
Reply with quote

i tried repro infile(abc.d*.xyz) outfile(sysut2) but it is not working...
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Jul 03, 2012 9:45 pm
Reply with quote

My requirement is,

A customer will FTP a file to mainframe.
After the file is FTP'ed my job should process the records.

Note: File name is ABC.D*.XYZ.

As d.sch suggested in the previous post, i cannot use the symbolic parameter. D* changes every time when the file is FTP'ed.

This is supposed to be an automatic process, i am not supposed to run the job overriding the symbolic parameter everytime.

I cannot use REXX, Internal JCL also.. Anything else is possible?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 03, 2012 9:52 pm
Reply with quote

First: JCL is fixed once it goes through the converter / interpreter phase of JES (after the job is submitted, in other words). From that point forward, the JCL cannot be changed in any way, shape, style, or fashion -- hence if you mean your JCL is supposed to be changed to reflect the actual data set name WHILE THE JOB IS RUNNING, this cannot be done, at all, ever -- period.

Second, dynamic allocation is supported in a variety of way -- SVC call, Assembler code, or use of BPXWDYN for COBOL and other languages. Dynamic allocation does not change the JCL but does allow a DD name to be allocated while a job is running. The data set name, however, must be known when the dynamic allocation is done.

Given these two points, try to explain exactly what it is you are attempting to accomplish, especially these points:
1. When do you know the data set name?
2. If you cannot use REXX, what can you use?
3. Is this a homework assignment?
4. What do you need to do with the data set once it is allocated -- read? write? both?
5. Is the data set on tape?
6. Is the data set non-sequential?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jul 03, 2012 9:57 pm
Reply with quote

well, since we are so clever as to create unique dataset names everyday,
how about the ftp job also send a member to the jcl include library,
containing the dsn?

i mean using gdg's would make all this hocus-pocus pc bs moot,
but since this seems to be one of the more advanced sites,
where they know better, good luck.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jul 03, 2012 10:01 pm
Reply with quote

Hello,

Quote:
As d.sch suggested in the previous post, i cannot use the symbolic parameter. D* changes every time when the file is FTP'ed.
Saying that you cannot does not make this true. . .

Something has to know (or discover) the actual dataset name or the process is not going to run. Also, the D* is not workable as there may be lots of old files that match the same dataset name pattern.

Why did someone believe this was a proper implementation?

Is there any reason the file cannot be simply a new generaton of a GDG?
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Jul 03, 2012 10:35 pm
Reply with quote

My requirement is,

A customer will FTP a file 'ABC.D*.XYZ' to mainframe and the customer is requesting me to process the records after it is FTP'ed.

I will set the job and move to production, after that i dont have control over the job run. so, i cannot override D* (symbolic parameters) everytime before i run the job.

D* is customer ID - it is a 6 digit value. Any customer can FTP the file so the 6 digit value changes dynamically. This is unpredictable, the customer will FTP the file at 11 AM daily and i will schedule the job to run at 12.

After the file is processed, my process have to delete the file. so in most cases there will be only one file in the name mentioned above.
Two or three in case of production delays.

This is the requirement from client and he i not ready to change it.

I am going to read the file sequentially. This will not be a tape. My implementation team says i should not use REXX and internal JCL's.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Jul 03, 2012 10:36 pm
Reply with quote

if there are more than one files selected in ABC.D*.XYZ then the job should fail.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Jul 03, 2012 10:41 pm
Reply with quote

why not involve the cognizant experts,
since they provide IT consulting services, why not use them icon_cool.gif
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Tue Jul 03, 2012 10:47 pm
Reply with quote

Every expert is suggesting REXX which am not supposed to use.. icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jul 03, 2012 11:47 pm
Reply with quote

Hello,

How would rexx help determine the "magic" value?

How many customers might submit a file like this each day?

Neither Rexx not JCL is a silver bullet that will resolve unknowns. . .

Is there any business reason the process cannot create a new generation of a GDG?
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Wed Jul 04, 2012 12:36 pm
Reply with quote

What scheduler do you use? If it's TWS, you can use dataset triggering and pass in the name of the triggering dataset as a JCL variable.

I daresay other schedulers offer similar functionality.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Wed Jul 04, 2012 2:28 pm
Reply with quote

REXX LISTCAT would resove this correct?
will return an array (stem) if the length is more than 1 then there are more than one files selected....

Every day a customer will submit a file... (only one file everyday)..

we use CTRL-M for scheduling...

Customer says there are busines reasons and he cannot alter the existing process...

I have explained the technical difficulty to my implementation team... if they approve REXX than my issue is resolved....
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Jul 04, 2012 7:26 pm
Reply with quote

Taking a bit of a hike around Robin Hood's barn...

In step 1 execute IDCAMS LISTCAT and allocate SYSPRINT to a temporary data set. In step 2 parse that data set in a program (I'd use PL/I, but you don't list it in your profile; I expect that it can be done in COBOL) and determine if there is more than one customer data set, setting the return code appropriately. In step 3a (return code = one data set), do the desired business processing; in steps 3b (return code > one data set) and 3c (return code = zero data sets -- mustn't forget that), do the desired error processing.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Wed Jul 04, 2012 9:11 pm
Reply with quote

Good idea... I will try this... thanks..
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jul 05, 2012 1:43 pm
Reply with quote

What John says, I was trying it yesterday and found it that with z/OS 1.11
Code:
LISTCAT ENT('HLQ.F*.FILE') ALL
ends in
Code:
LISTCAT ENT('HLQ.F*.FILE') ALL     
IDC3012I ENTRY HLQ.F* NOT FOUND     
IDC3007I ** VSAM CATALOG RETURN CODE IS 8
IDC1566I ** HLQ.F*.FILE NOT LISTED   
IDCAMS  SYSTEM SERVICES                 

And that is kind of Data-set name you provided in the very forst of yours. However, this worked
Code:
LISTCAT ENT('HLQ.*.FILE') ALL

but this leads to make sure that for a given day the ONLY DSN of type "HLQ.*.FILE" is the DSN-of-your-interest otherwise you'll screw the jobs.
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Thu Jul 05, 2012 5:41 pm
Reply with quote

I got approval from my implementation team for rexx.. below is the code and is working.. Thank you all for your excellent suggestions....

I am posting this code for others to use in future...

Code:

PARSE ARG FILENAME                       
SAY 'FILENAME : ' FILENAME               
X = OUTTRAP(FILELIST.)                   
"LISTCAT LEVEL ("FILENAME")"             
X = OUTTRAP(OFF)                         
TOTAL = FILELIST.0                       
IF RC >  04 THEN                         
DO                                       
     SAY 'ERROR ERROR ERROR!!!!!!!!!!!!'
     SAY 'FILE NOT FOUND               '
     RC=16                               
     EXIT                               
END                                     
IF TOTAL = 2 THEN                       
  DO                                     
     PARSE VAR FILELIST.1 VAR1 VAR2 VAR3
     VAR3 = STRIP(VAR3)                 
     CARD.0=3                           
     CARD.0=3                             
     CARD.1 ='REPRO -'                     
     CARD.2 ='INFILE('|| VAR3 ||') -'     
     CARD.3 = 'OUTFILE(OUTDD)'             
     SAY '*****************************'   
     SAY CARD.1                           
     SAY CARD.2                           
     SAY CARD.3                           
     SAY '*****************************'   
     'EXECIO * DISKW CARD(FINIS STEM CARD.'
  END                                     
ELSE                                       
  DO                                       
     SAY 'ERROR ERROR ERROR!!!!!!!!!!!!'   
     SAY 'MORE THAN ONE FILE FOUND     '   
     RC=08                                 
  END                                     


JCL below....
File name:XXX.YYYYYY.*.TEST11

Code:

//XXXNDREX JOB ('****************************'),     
//    JOBCARD,CLASS=2,MSGCLASS=H,NOTIFY=&SYSUID     
//STEPRUN  EXEC PGM=IKJEFT01                         
//SYSEXEC  DD DSN=XXXND.B2B.USCHINA.PROCDATA,DISP=SHR
//SYSOUT   DD SYSOUT=*                               
//INPUT    DD DSN=XXXND.B2B.USCHINA.PROCDATA,DISP=SHR
//CARD     DD DSN=XXXES.TEST.TESTWER,DISP=SHR       
//SYSTSPRT DD SYSOUT=*                               
//SYSTSIN  DD *                                     
 %TEST123  XXX.YYYYYY.*.TEST11                       
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Jul 05, 2012 7:11 pm
Reply with quote

Good to hear it is working - thank you for posting your solution icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> FAQ & Basics

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top