Page 1 of 1

mainframe copybook - occurs question

Posted: Mon Sep 19, 2011 9:43 am
by lindakampa
I am trying to convert an EBCDIC file with zoned decimal to an ASCII tab delmited file. I am having a problem with the copybook wizard where it doesn't interpret the following OCCURS syntax correctly:

03 XXXX-PENDING-PYMT-SCHED OCCURS 24 TIMES.
04 XXXX-PEND-SCHED-START-DATE PIC S9(8)V9(5). 7,535 A
04 XXXX-PEND-SCHED-FREQUENCY PIC S9. 7,548 A
04 XXXX-PEND-NUMBER-OF-PYMTS PIC S9(3). 7,549 A
04 XXXX-PEND-AMOUNT-OF-PYMT PIC S9(11)V99. 7,552 A
04 XXXX-PEND-ESCROW-PAYMENT PIC S9(7)V99. 7,565 A
04 XXXX-PEND-SCHED-RATE PIC S9(3)V9(4). 7,574 A
04 XXXX-PEND-PYMT-OCCURRENCES PIC S9(3). 7,581 A
04 XXXX-PEND-PYMT-RECALC-CODE PIC S9(3). 7,584 A

This type of OCCURS is working correctly:
03 XXXX-SIGNER-FLAG OCCURS 100 TIMES PIC S9. 15,494 A

Do you know of a way I can get the first group to repeat the 8 fields 24 times?

Thanks in advance for your help!

Linda Kampa

Re: mainframe copybook - occurs question

Posted: Mon Sep 19, 2011 10:47 am
by lindakampa
I wanted to clarify what the issue is - the first set of logic below outputs one copy of set of the fields, instead of outputting the 24 occurrences.
Thanks! Linda Kampa

Re: mainframe copybook - occurs question

Posted: Tue Sep 20, 2011 9:48 pm
by DataMystic Support
Hi Linda,

The '7,535 A' text at the end of each line is not correct and needs to be removed ie.

Code: Select all

03 XXXX-PENDING-PYMT-SCHED OCCURS 24 TIMES.
04 XXXX-PEND-SCHED-START-DATE PIC S9(8)V9(5). 
04 XXXX-PEND-SCHED-FREQUENCY PIC S9. 
04 XXXX-PEND-NUMBER-OF-PYMTS PIC S9(3). 
04 XXXX-PEND-AMOUNT-OF-PYMT PIC S9(11)V99. 
04 XXXX-PEND-ESCROW-PAYMENT PIC S9(7)V99. 
04 XXXX-PEND-SCHED-RATE PIC S9(3)V9(4).
04 XXXX-PEND-PYMT-OCCURRENCES PIC S9(3). 
04 XXXX-PEND-PYMT-RECALC-CODE PIC S9(3). 
Also - we recommend you use the Mainframe Copybook Filter instead of the wizard (the wizard generates a stack of filters for you, while the Mainframe Copybook Filter keeps them behind the scenes).