Hi all.
I would like to know that how can I code a map which has several fields like this.
LOCATION : __________
S NO. NAME DEPARTMENT
____ __________ ________________
____ __________ ________________
____ __________ ________________
____ __________ ________________
____ __________ ________________
____ __________ ________________
____ __________ ________________
Location :- char(10)
S.no :- char(03)
Name :- char(10)
Department :- char(15)
These are the output fields where the data is given in the location and values inside the table are fetched if they match with the location here.
Note :- I have coded the map until the "S.NO NAME DEPARTMENT" row.
But I could not understand how to code the next fields in the map as it is difficult to hard code for each line individually.
Others say that there is an array concept in CICS. But I was unable to get a clear answer from others as well.
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
Are you using BMS? SDF II? Some other screen development tool you didn't bother to mention?
Have you clicked on the Manuals link at the top of this page, found the CICS Application Programming Reference manual (called Language Reference on the Manuals page), and read A.9.3 on DFHMDF -- particularly the parts about GRPNAME and OCCURS?
You DO realize, I hope, that if you had just coded the map fields, you would have a compiled map by now, rather than waiting for forum responses?
I have referred the manual Mr.Bill Woodger.
I found the same syntax there.
I could not understand why the fields are overlapping if the OCCURS is used here.
Correct me if I am wrong.
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
You ARE aware, I hope, that map definition goes left to right on each line, then top to bottom from line to line? Hence defining a field at (8,2) with a length of 1 and OCCURS=15 is not going to give you 15 lines of data starting in the 2nd column of each line, but 15 bytes defined on line 8.
Yes sir.
You are absolutely right about this.
The map is (24,80) size.
I have checked the number of rows coded in the map also.
The program doesn't violate coding beyond 24 rows too.
1,3,4,5,6,7,8, then the 15 lines(USING OCCURS) and 24th row(last line) are the rows I have coded in.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Really? How come 8,2 with a length of 15 (or a length of 1 15 times) doesn't "overlap" 8,5? Which you haven't seemed to pick up on even with Robert pointing it out to you...
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
I just googled to see what type of stuff is out there:
CICS Transaction Server v2.3 wrote:
Repeated fields: the OCCURS option
Sometimes a screen contains a series of identical fields that you want to treat as an array in your program. Suppose, for example, that you need to create a display of 40 numbers, to be used when a clerk assigns an unused telephone number to a new customer. (The idea is to give the customer some choice.) You also want to highlight numbers which have been in service recently, to warn the customer of the possibility of calls to the previous owner.
You can define the part of your screen which shows the telephone numbers with a single field definition:
This statement generates 40 contiguous but separate display fields, starting at position (7,1) and proceeding across the rows for as many rows as required (five, in our case). We have chosen a length that (with the addition of the attributes byte) divides the screen width evenly, so that our numbers appear in vertical columns and are not split across row boundaries. The attributes you specify, and the initial value as well, apply to each field.
Now, if you can show what you have discovered which says different, then we can say why it is wrong.
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
Quote:
I understood what you say here.
I referred the manual also.
It was the same what I code here.
But I am unable to code it from overlapping.
Please tell me how to code it properly.
The fields are overlapping because as you have them coded they go across the row from (8,2) to (8,3) to (8,4) to (8,5) -- hence the overlap -- and I believe your basic problem is that you do not understand the OCCURS will not flow DOWN the screen from line to line but rather ACROSS the screen, completely filling row 8 before starting on row 9.
Quite simply, I am not aware of any way to get an OCCURS in BMS to flow from line to line, which means you are going to have to code up the field definitions for each and every line. Your original post has 3 fields per line, so you'll need AT LEAST 45 field definitions in your BMS map to define all 15 lines (60 if you use a stop attribute).
I got your point.
And I coded each and every field in the map separately.
And my map is ready with 500 lines of code in it.
And the output looks similar to my requirement.
I don't know how to paste an image here. Else would have shown the MAP.
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
I am not a CICS guy, but MFS (an IMS thing very similar to BMS) has a DO / ENDDO structure that lets you define repeated lines. Does BMS have something similar?