Hello, people! I am new in here and may ask some silly questions. Please, don't scream
I just started to code my first map in X12. The output - simple delimited file with one header H and multiple M details. I need to be able to count all detail lines, that follow each header H record.
Simply to say:
H
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4 etc...
H
M,,,,,,,,1
M,,,,,,,,2
M,,,,,,,,3
M,,,,,,,,4 etc...
I get the numbers using GETANDSET, but unfortunately, I don't know how to initialize the index after each H record. The ouput that I get looks like this:
H
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4 etc...
H
M,,,,,,,,5
M,,,,,,,,6
M,,,,,,,,7
M,,,,,,,,8 etc...
I appreciate all your help!!!
WTX Mapping question
Re: WTX Mapping question
Hi edi1ssd,
You need to set the initiator in the component list in the Type Tree in the Record Group Type Component list, provided that your input file contains the "H" as the first element in the group record. That should solve your problem.
You need to set the initiator in the component list in the Type Tree in the Record Group Type Component list, provided that your input file contains the "H" as the first element in the group record. That should solve your problem.
edi1ssd wrote:Hello, people! I am new in here and may ask some silly questions. Please, don't scream
I just started to code my first map in X12. The output - simple delimited file with one header H and multiple M details. I need to be able to count all detail lines, that follow each header H record.
Simply to say:
H
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4 etc...
H
M,,,,,,,,1
M,,,,,,,,2
M,,,,,,,,3
M,,,,,,,,4 etc...
I get the numbers using GETANDSET, but unfortunately, I don't know how to initialize the index after each H record. The ouput that I get looks like this:
H
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4 etc...
H
M,,,,,,,,5
M,,,,,,,,6
M,,,,,,,,7
M,,,,,,,,8 etc...
I appreciate all your help!!!
RFox
Doesn't work. ':('
My input is EDI data. The output is the flat commspec format, and the first record in the group starts with H.
This is what I need:
H,,,,,
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4
H,,,,
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4
I have this record layout in the type tree:
Comfile-out-data (s)
File-group_out
Header_rec Records (put the Restart Attribute here?)
Item1_rec(s)
Item2_rec(s)
Item3_rec(s)
Item4_rec (s)
And this is what I got, when put the Restart attribute on the Header_rec Rcords
H,,,,,,,
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4
H,,,,
M,,,,,,,5
M,,,,,,,6
M,,,,,,,7
M,,,,,,,8
Not sure though, is there any other initiator somewhere?
In my detail line i have a field for this: Line# and I set up the Index and use it in the rule =GETANDSET(In3, In3 +1, 1 ). Unfortunately, it counts the lines, but not exactly the way I need it. In Cobol I know I would initialize the index or field. But here...don't now. Any other thoughts? Thank you so much!
My input is EDI data. The output is the flat commspec format, and the first record in the group starts with H.
This is what I need:
H,,,,,
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4
H,,,,
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4
I have this record layout in the type tree:
Comfile-out-data (s)
File-group_out
Header_rec Records (put the Restart Attribute here?)
Item1_rec(s)
Item2_rec(s)
Item3_rec(s)
Item4_rec (s)
And this is what I got, when put the Restart attribute on the Header_rec Rcords
H,,,,,,,
M,,,,,,,1
M,,,,,,,2
M,,,,,,,3
M,,,,,,,4
H,,,,
M,,,,,,,5
M,,,,,,,6
M,,,,,,,7
M,,,,,,,8
Not sure though, is there any other initiator somewhere?
In my detail line i have a field for this: Line# and I set up the Index and use it in the rule =GETANDSET(In3, In3 +1, 1 ). Unfortunately, it counts the lines, but not exactly the way I need it. In Cobol I know I would initialize the index or field. But here...don't now. Any other thoughts? Thank you so much!
-
- Participant
- Posts: 12
- Joined: Mon Mar 31, 2008 11:39 pm
-
- Participant
- Posts: 12
- Joined: Mon Mar 31, 2008 11:39 pm
Not sure I understand the question so... If you want assign a record number to each record 'M' in each group 'H' use INDEX($) at the record level....
f_map_record_m(input card 1, input card n, index($))
or
f_map_record_m(input card 1, input card n, index(input that drive unique record))
Using the index function at the 'M' record level will reset the index to 1 at each group 'H'.
f_map_record_m(input card 1, input card n, index($))
or
f_map_record_m(input card 1, input card n, index(input that drive unique record))
Using the index function at the 'M' record level will reset the index to 1 at each group 'H'.