View previous topic :: View next topic
|
Author |
Message |
mercy Warnings : 1 New User
Joined: 25 Jun 2006 Posts: 10 Location: Bangalore
|
|
|
|
Hi,
Can anybody help me out of this???
The below declarations are from the copy book CLM_DATA.
The same copy book is used for both input and output files so I used
HS-SVC-CD OF CLM_DATA as i need to filter the records from the input.
10 HIDDEN-RMC PIC X(2).
10 RPT-LN-ITEM-CNT PIC S9(3) COMP-3.
05 LINE-DATA-OCCURS OCCURS 1 TO 65 TIMES
DEPENDING ON RPT-LN-ITEM-CNT
INDEXED BY LN-INDX.
10 HS-SVC-CD PIC X(3).
10 RPT-HML-PRCG-SVC-CD PIC X(03).
HOW CAN I CHECK THE CONDITIONS THAT ARE BELOW.
IF ((HS-SVC-CD OF CLM_DATA = 'PHO' OR 'PRV') AND
(HS-PROC-SVC-CLS-CD OF CLM-DATA = '01C'
OR '07B' OR '07C'
OR '07D' OR '01I' OR '07F' OR '07I' OR '07K'
OR '07L' OR '07M' OR '07T'))
WS-WRITE = 'T'
END-IF
can anybody specify the code for this?
Thanq Very Much in advance.
Mercy. |
|
Back to top |
|
|
vicky10001 Warnings : 1 Active User
Joined: 13 Jul 2005 Posts: 136
|
|
|
|
Please explain cleary your requirement |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
you can use COPY as
COPY TEXTNAME IN LIBNAME
This will replace the copy with content of text file and all in text file will be inseted in to the source code all rules for programming are applicable to content of text file |
|
Back to top |
|
|
mercy Warnings : 1 New User
Joined: 25 Jun 2006 Posts: 10 Location: Bangalore
|
|
|
|
10 HIDDEN-RMC PIC X(2).
10 RPT-LN-ITEM-CNT PIC S9(3) COMP-3.
05 LINE-DATA-OCCURS OCCURS 1 TO 65 TIMES
DEPENDING ON RPT-LN-ITEM-CNT
INDEXED BY LN-INDX.
10 HS-SVC-CD PIC X(3).
10 RPT-HML-PRCG-SVC-CD PIC X(03).
HOW CAN I CHECK THE CONDITIONS THAT ARE BELOW.
IF ((HS-SVC-CD OF CLM_DATA = 'PHO' OR 'PRV') AND
(HS-PROC-SVC-CLS-CD OF CLM-DATA = '01C'
OR '07B' OR '07C'
OR '07D' OR '01I' OR '07F' OR '07I' OR '07K'
OR '07L' OR '07M' OR '07T'))
WS-WRITE = 'T'
END-IF
In the above if stmt HS-SVC-CD is a field which is present inside OCCURS clause.So for every value of HS-SVC-CD I need to check the condition.Similarly for every value of HS-PROC-SVC-CLS-CD.So how can i do this. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
From the example, I see that there is no level 01 in the COPY itself.
You can declare:
Code: |
01 CLM-DATA-INP.
COPY CLM_DATA.
01 CLM-DATA-OUT.
COPY CML_DATA. |
Then you can use HS-SVC-CD OF CLM-DATA-INP and HS-SVC-CD OF CLM-DATA-OUT
On the other hand, if you had a level 01 inside the COPY, you could declare:
Code: |
COPY CLM_DATA REPLACING ==Level01Name== BY ==NewName1==.
COPY CLM_DATA REPLACING ==Level01Name== BY ==NewName2==. |
Then you could use HS-SVC-CD OF NewName1 and HS-SVC-CD OF NewName2 |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Quote: |
10 HIDDEN-RMC PIC X(2).
10 RPT-LN-ITEM-CNT PIC S9(3) COMP-3.
05 LINE-DATA-OCCURS OCCURS 1 TO 65 TIMES
DEPENDING ON RPT-LN-ITEM-CNT
INDEXED BY LN-INDX.
10 HS-SVC-CD PIC X(3).
10 RPT-HML-PRCG-SVC-CD PIC X(03). |
By the way, mixing levels as you do in the CLM_DATA is not healthy.
It works (I think it works) only by chance. I strongly recommend modifying the copy like this:
Code: |
05 HIDDEN-RMC PIC X(2).
05 RPT-LN-ITEM-CNT PIC S9(3) COMP-3.
05 LINE-DATA-OCCURS OCCURS 1 TO 65 TIMES
DEPENDING ON RPT-LN-ITEM-CNT
INDEXED BY LN-INDX.
10 HS-SVC-CD PIC X(3).
10 RPT-HML-PRCG-SVC-CD PIC X(03). |
or like that:
Code: |
10 HIDDEN-RMC PIC X(2).
10 RPT-LN-ITEM-CNT PIC S9(3) COMP-3.
10 LINE-DATA-OCCURS OCCURS 1 TO 65 TIMES
DEPENDING ON RPT-LN-ITEM-CNT
INDEXED BY LN-INDX.
12 HS-SVC-CD PIC X(3).
12 RPT-HML-PRCG-SVC-CD PIC X(03). |
|
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Mercy,
Your ques is incomplete. You must tell us the 01 levels that the copybook appears in or is the 01 level in the copybook?
The ans you want depends on us knowing this fact. Show us as much as you can if you want us to be of any help. |
|
Back to top |
|
|
|