Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Thu Jun 08, 2017 3:35 am Post subject: File manager (IMS) in batch
I'm reading up as much as possible on how to run File Manager (IMS Component) in batch, but the example (singular) is lacking in explanations as to how things tie together. An example
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Thu Jun 08, 2017 7:04 am Post subject:
From the File Manager 12.1 documentation found by searching on...
Quote:
'file manager' AND pcbnum[
...
Quote:
PCBNUM=pcbnum
When the specified PSB has multiple PCBs for the database specified in the DBDMEM parameter, you specify in this parameter which PCB you want the function to use. You do this by specifying the ordinal number that indicates the position of the PCB in the PSB. So, if you want the function to use the first database PCB in the PSB, you specify 1. If you want the function to use the second database PCB in the PSB, you specify 2, and so on.
_________________ Utility and Program control cards are NOT, repeat NOT, JCL.
Does anyone have an example they would be prepared to share (with explanations as to how things tie together)
Misi01,
I am not sure as to where you looked but, in the same manual that you linked there is a detail explanation of ALL the parms that are used.
You are looking at Batch Edit (IEB) function, but if you back up a bit to "batch reference" (You can click on the breadcrumb url from your link) you will get this
And then click on Extract (IXB) and then you will see the explanation for "FMIMSIN control statements" and it shows you ALL the parms with detailed explanation. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Fri Jun 09, 2017 1:39 am Post subject: Thank you for the pointers Kolusu.
I recognize the URL's you included and had visited them. My inability to find the reference you included was based on the following google search
Quote:
"file manager" +pcbnum
Of all the sites I found (via work), the only IBM site had no explanation of the PCBNUM parms, only that they existed.
Be that as it may, I had already visited those sites and found them rather difficult to understand/follow (wood and trees comes to mind). _________________ Michael
When I run this without the VIEWIMS (and with Ã…Ã…FILEM CRITERIA=Y,) , everything works "fine" (I'm not saying that the criteria IS used, just that the JCL gives an RC of 0).
In the manuals, every single example I can find seems to be referring to templates rather than criteria.
What I imagine I could do is something like
Code:
Ã…Ã…FILEM PROC=*
/* Point to my criteria definieion */
filerc = VIEWIMS('TPLDSN=xxxx.UT1PROJ.CRITERIA(S1491B1)')
filerc = GETIMS(some parm here )
do while filerc = 0
print/select/do something
filerc = GETIMS(some parm here )
end
/+
As it is, the first example is giving the following error
Quote:
say 'I was here'
filerc = VIEWIMS('TPLDSN=xxxx.UT1PROJ.CRITERIA(S1491B1)')
filerc = GETIMS('SEGMENT=VNOACD0 NEXT')
say 'filerc = 'filerc
say 'Inrec ***'inrec
FMNBB060 REXX procedure statements processed by REXX.
I was here
FMNBA310 Data set xxxx.UT1PROJ.CRITERIA(S1491B1) not found
FMNIA086 TPLDSN data set xxxx.UT1PROJ.CRITERIA(S1491B1) was not found in the cat
4 +++ filerc = VIEWIMS('TPLDSN=xxxx.UT1PROJ.CRITERIA(S1491B1)')
Anyone have any suggestions ? _________________ Michael
and then choose the version your shop has and then pick the component you working with (IMS, DB2...)
In this case you are working with IMS, so I would download the PDF "User's Guide and Reference for IMS Data"
Once I have the manual then it is easy to search within the manual.
misi01 wrote:
Be that as it may, I had already visited those sites and found them rather difficult to understand/follow (wood and trees comes to mind).
I would say IBM does a better job of having the manuals available online and downloadable PDF copies that you can always search. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
Posted: Fri Jun 09, 2017 11:24 am Post subject:
misi01 wrote:
A follow-on question. I'm getting somewhere and will post my results as and when I manage.
Reviewing the online doc, I'm having trouble understanding how/if I can use a defined criteria as my view. My FILEM look like this
Code:
FILEM CRITERIA=N,
//CRITDD DD DSN=xxxx.UT1PROJ.CRITERIA(S1491B1),DISP=SHR
//*
When I run this without the VIEWIMS (and with FILEM CRITERIA=Y,) , everything works "fine" (I'm not saying that the criteria IS used, just that the JCL gives an RC of 0).
mis01,
Apart from specifying CRITERIA=Y, you also need to specify the criteria dataset/ddname in your control cards.
As it is, the first example is giving the following error
FMNBA310 Data set xxxx.UT1PROJ.CRITERIA(S1491B1) not found
FMNIA086 TPLDSN data set xxxx.UT1PROJ.CRITERIA(S1491B1) was not found in the cat
misi01,
The errors are self explanatory. You don't have a member named S1491B1 in your PDS named xxxx.UT1PROJ.CRITERIA
Ideally I would start with using the FILE MANAGER panels for Criteria processing and then convert that into a batch job.
In the PDF "User's Guide and Reference for IMS Data" there is an entire chapter about Criteria. "Chapter 7. Working with Criteria"
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Mon Jun 12, 2017 2:22 am Post subject:
I have downloaded the manual, but it STILL doesn't help. Here are some screen captures to try and convince you I'm NOT an idiot. First, my FM batch commands:-
Template:
Data set name . . . 'xxxx.UT1PROJ.TEMPLATE'
Member . . . . . . VNOPC00
Now the results from submitting the job.
Quote:
say 'I was here'
filerc = VIEWIMS('TPLDSN=TGCC.UT1PROJ.TEMPLATE(VNOPC00)')
filerc = GETIMS('SEGMENT=VNOACD0 NEXT')
say 'filerc = 'filerc
say 'Inrec ***'inrec
FMNBB060 REXX procedure statements processed by REXX.
I was here
FMNBA310 Data set xxxx.UT1PROJ.TEMPLATE(VNOPC00) not found
FMNIA086 TPLDSN data set xxxx.UT1PROJ.TEMPLATE(VNOPC00) was not found in the cat
4 +++ filerc = VIEWIMS('TPLDSN=xxxx.UT1PROJ.TEMPLATE(VNOPC00)')
IRX0040I Error running FMNINTEX, line 4: Incorrect call to routine
FMNBB382 REXX exec terminated with RC 20040
DFSUACB0 MESSAGES AND CONTROL STATEMENTS
DELETE PSB=FMN0046
Now, something I did notice in the manual, was that as far as I could see, there were no examples of TPLDSN being specified as a PDS - is that the problem ??? _________________ Michael
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Mon Jun 12, 2017 3:59 am Post subject:
My next attempt
Code:
0FMNBC514 REXX procedure statements read from SYSIN.
say 'I was here'
filerc = VIEWIMS('TPLDD=TEMPLATE')
filerc = GETIMS('SEGMENT=VNOACD0 NEXT')
say 'filerc = 'filerc
say 'Inrec ***'inrec
0FMNBB060 REXX procedure statements processed by REXX.
I was here
0FMNIA557 The TEMPLATE DD statement specifies a PDS(E) member. Specify the Templ
4 +++ filerc = VIEWIMS('TPLDD=TEMPLATE')
IRX0040I Error running FMNINTEX, line 4: Incorrect call to routine
0FMNBB382 REXX exec terminated with RC 20040
1 DFSUACB0 MESSAGES AND CONTROL STATEMENTS
- DELETE PSB=FMN0044
DFS0938I DELETE PROCESSING COMPLETE FOR PSB FMN0044
Note how this time I actually received an error message giving SOME idea of what might be in error (BTW - tried to look up FMNIA557
in the online manual, but it's not there. The one before is FMNIA460, the one after is FMNIA999) _________________ Michael
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Mon Jun 12, 2017 4:15 am Post subject:
You have to laugh. Talk about you're damned if you do, you're damned if you don't. Based on my previous append, I included the following JCL so as to copy the base template from a PDS to a sequential file.
Guess what? Now I'm getting the following error message
Quote:
say 'I was here'
filerc = VIEWIMS('TPLDD=TEMPLATE')
filerc = GETIMS('SEGMENT=VNOACD0 NEXT')
say 'filerc = 'filerc
say 'Inrec ***'inrec
FMNBB060 REXX procedure statements processed by REXX.
I was here
FMNIA556 The data set specified in the TEMPLATE DD is not a PDS(E). Specify
4 +++ filerc = VIEWIMS('TPLDD=TEMPLATE')
IRX0040I Error running FMNINTEX, line 4: Incorrect call to routine
FMNBB382 REXX exec terminated with RC 20040
DFSUACB0 MESSAGES AND CONTROL STATEMEN
DELETE PSB=FMN0018
DFS0938I DELETE PROCESSING COMPLETE FOR PSB FMN0018
So.... what's it to be; PDS(E) or not ?????
(Oh, and as I mentioned earlier, FMNIA556 isn't in the manual either) _________________ Michael
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Mon Jun 12, 2017 8:06 am Post subject:
The manual does not specify quotes around the parm to VIEWIMS. I did not check the format for GETIMS. _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
I've had a colleague try and help me as well, and we're getting what I would consider strange results (they're obviously not, but since I can't manage to get FM working as I expect, they're strange). First of all, a basic batch FM job
This is what I expect. When I do it using Rexx code instead
Code:
Ã…Ã…FILEM PROC=*
say 'I was here'
filerc = VIEWIMS('TPLDD=TEMPLATE')
/* GETIMS next will show root segment */
filerc = GETIMS('NEXT')
print(inrec,sngl)
say 'filerc = 'filerc
say 'Inrec ***'inrec
do i = 1 to 3
filerc = GETIMS('NEXT')
say 'filerc = 'filerc
say 'Inrec ***'inrec
print(inrec,sngl)
end
/+
which to me seems to indicate that the criteria hasn't been used in the selection.
So, basically, I'm wondering as to HOW you're supposed to specify a criteria and use VIEWIMS/GETIMS to ensure you ONLY see those selected segments. _________________ Michael
Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
Posted: Mon Jun 12, 2017 10:58 am Post subject:
misi01 wrote:
So, basically, I'm wondering as to HOW you're supposed to specify a criteria and use VIEWIMS/GETIMS to ensure you ONLY see those selected segments.
Misi01,
I am not sure as to why you simply tend to ignore the earlier message about specifying the criteria details in the control cards itself? I even showed you the syntax diagram and you simply seem to ignore and try all kinds of combinations. Just because you have CRITDD in your JCL does NOT mean file manager will read the dataset. Unless you point to it, filemanager will simply ignore the dd name. Pay attention to the 2 lines which specify <<< New addition
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
Posted: Mon Jun 12, 2017 12:11 pm Post subject:
Thank you Kolusu. However......
what is your comment regarding page 469 of the V13.1 manual. Tomorrow, I'll try your example, but here are the relevant lines from that page
Quote:
CRITERIA
Optional parameter. Specifies whether or not the Extract uses selection
criteria.
N The Extract does not use selection criteria.
Y The Extract uses selection criteria. If Y is specified, you must
specify the criteria set that the extract is to use as outlined in the
CRITDD, CRITDSN and CRITMEM entries below. CRITDD=ddname
Identifies the DD statement for the sequential data set or PDS(E)
and member that contains the criteria you want your Extract to
use. The default is CRITDD.
Now, that to me says I can use any of the options, and if I specify CRITERIA=Y, then by default, the file specified with a DD name of CRITDD will be used.
If what you're saying is that I have to use CRITERIA=Y and CRITDD=CRITDD (in this example), then that's where my misunderstanding has been.
I think I've tried the CRITERIA=Y with the CRITDSN/CRITMEM, but I'll try again tomorrow at work _________________ Michael
Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
Posted: Mon Jun 12, 2017 12:15 pm Post subject:
misi01 wrote:
Thank you Kolusu. However......
what is your comment regarding page 469 of the V13.1 manual. Tomorrow, I'll try your example, but here are the relevant lines from that page
Quote:
CRITERIA
Optional parameter. Specifies whether or not the Extract uses selection
criteria.
N The Extract does not use selection criteria.
Y The Extract uses selection criteria. If Y is specified, you must
specify the criteria set that the extract is to use as outlined in the
CRITDD, CRITDSN and CRITMEM entries below. CRITDD=ddname
Identifies the DD statement for the sequential data set or PDS(E)
and member that contains the criteria you want your Extract to
use. The default is CRITDD.
Now, that to me says I can use any of the options, and if I specify CRITERIA=Y, then by default, the file specified with a DD name of CRITDD will be used.
If what you're saying is that I have to use CRITERIA=Y and CRITDD=CRITDD (in this example), then that's where my misunderstanding has been.
I think I've tried the CRITERIA=Y with the CRITDSN/CRITMEM, but I'll try again tomorrow at work
Misi01,
If I understood correctly, the CRITDD is the default name for Criteria dataset. That does NOT mean that just because you have CRITDD in the JCL it will be read. So you need to specify the CRITDD in your control cards too. _________________ Kolusu
www.linkedin.com/in/kolusu
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