EBCDIC - multi copybooks, recordId and link col err

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
patrickthatcher@gmail.com
Participant
Posts: 5
Joined: Wed Nov 22, 2017 11:39 am

EBCDIC - multi copybooks, recordId and link col err

Post by patrickthatcher@gmail.com »

First time using CFF stage. Sorry for what maybe a simple question but I've searched the Google and this site and can't find my particular problem. I'm having multiple issues that maybe readily apparent to someone.

Background:
We downloaded a mainframe file to our unix server that we need to convert to ASCII.
We were given the following copy book information

Code: Select all

000010* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *     00010
000020*    RDSRDK00,DK00                                  05/25/88  *     00020
000030*    THIS IS THE DEFINITION OF THE BIG TICKET FILE            *     00030
000040*    TRACKS DATA ELEMENT RDK00 IN THE FILE                    *     00040
000050*    'RDK'.                                                   *     00050
000060*                                                             *     00060
000070*            RDK00     AUDIT-STAMP            1-26      26    *     00070
000080*                                                             *     00080
000090* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *     00090
000100*-------------------------------------------------------------*
000110*---------------  INCLUDE MODIFICATION -----------------------*
000120*-------------------------------------------------------------*
000130*        MAINTENANCE LOG - ADD LATEST CHANGE TO THE TOP       *
000140* MOD-DATE PROGRAMMER  MOD DESCRIPTION                        *
000150* -------- ----------  ---------------------------------------*
000160* 03/23/09 B052VHK    - CODE CHANGES FOR RDS ANX              *   VK090323
000170*-------------------------------------------------------------*
000180     01  RDK00-TRACKS.                                              00100
000190         15  RDK00-FILE          PIC  X(03).                        00110
000200         15  RDK00-PGM-ID        PIC  X(03).                        00120
000210         15  RDK00-PGM-NBR       PIC S9(03) COMP-3.                 00130
000220         15  RDK00-TDATE         PIC S9(07) COMP-3.                 00140
000230*                DATE FORMAT (YYMMDD)                               00150
000240         15  RDK00-TTIME         PIC S9(07) COMP-3.                 00160
000250*                TIME FORMAT (HHMMSS)                               00170
000260         15  RDK00-TCRT          PIC  X(04).                        00180
000270         15  RDK00-OPER.                                            00190
000280             20  RDK00-INIT      PIC  X(02).                        00200
000290*            20  RDK00-EMPNO     PIC S9(06) COMP.                 VK090323
000300             20  RDK00-EMPNO     PIC S9(09) COMP.                 VK090323

Code: Select all

000010* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *     00010
000020*    RDSRDK01,DK01                                  05/25/88  *     00020
000030*    THIS IS THE DEFINITION OF THE BIG TICKET                 *     00030
000040*    CUSTOMER         DATA ELEMENT RDK01 IN THE FILE          *     00040
000050*    'RDK'.                                                   *     00050
000060*                                                             *     00060
000070*            KEY       DATA NAME               POSITIONS LGTH *     00070
000080*    M/N     RDKK1     RDK01-CUST-CONTROL-NBR    27-  30    4 *     00080
000090*  NO DUPS                                                    *     00090
000100*                                                             *     00130
000110*            RDKK3     RDK01-HOME-PHONE-NBR      37-  42    6 *     00140
000120*                      RDK01-LAST-NAME           43-  43    1 *     00150
000130*                                                             *     00160
000140*            RDKK4     RDK01-LAST-NAME           43-  67   15 *     00170
000150*                      RDK01-FIRST-NAME          63-  77   10 *     00180
000160*                                                             *     00190
000170*            RDKK5     RDK01-CUST-ACCT-NBR17    170- 178    9 *     00170
000180*                      RDK01-DIVISION           164- 165    2 *     00120
000190*                                                             *     00200
000200*            ELEMENTS OF FILE 'RDK'                           *     00210
000210*            RDK00     AUDIT-STAMP                1-  26   26 *     00220
000220*            RDK01     CUSTOMER DATA             27- 180  154 *     00230
000230*                                                             *     00240
000240* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *     00250
000250*                                                                   00260
000260     01  RDK01-ELEMENT.                                             00270
000270         15  RDK01-KEY.                                             00280
000280             20  RDK01-CUST-CONTROL-NBR     PIC S9(07)    COMP-3.   00290
000290*                                                                   00300
000300         15  RDK01-CUST-ACCOUNT-NBR         PIC S9(11)    COMP-3.   00310
000310*                                                                   00320
000320         15  RDK01-HOME-PHONE-NBR           PIC S9(11)    COMP-3.   00330
000330*                                                                   00340
000340         15  RDK01-CUSTOMER-NAME-ADDRESS.                           00350
000350             20  RDK01-LAST-NAME            PIC  X(25).             00360
000360             20  RDK01-FIRST-NAME           PIC  X(15).             00370
000370             20  RDK01-STREET-ADDRESS       PIC  X(25).             00380
000380             20  RDK01-CITY                 PIC  X(20).             00390
000390             20  RDK01-STATE                PIC  X(02).             00400
000400             20  RDK01-ZIP-CODE             PIC  9(05).             00410
000410*                                                                   00420
000420         15  RDK01-WORK-PHONE-NBR           PIC S9(11)    COMP-3.   00430
000430*                                                                   00440
000440         15  RDK01-FIRST-TRANS-DATE         PIC S9(09)    COMP-3.   00450
000450         15  RDK01-LAST-TRANS-DATE          PIC S9(09)    COMP-3.   00460
000460*                                                                   00470
000470         15  RDK01-NBR-TRANSACTIONS         PIC S9(05)    COMP-3.   00480
000480         15  RDK01-PURCHASES-TOTAL-AMT      PIC S9(07)V99 COMP-3.   00490
000490         15  RDK01-RETURNS-TOTAL-AMT        PIC S9(07)V99 COMP-3.   00500
000500*                                                                   00510
000510         15  RDK01-DIVISION                 PIC  9(02).             00520
000520*                                                                   00530
000530         15  RDK01-CUST-ACCT-MASK           PIC  S9(04)   COMP-3.   00540
000540         15  RDK01-IRN-CONV-FLG             PIC  X(01).           LY005500
000550             88  ACCOUNT-IS-PAN             VALUE 'P'.            LY005600
000560             88  ACCOUNT-IS-IRN             VALUE 'I'.            LY005700
000570             88  ACCOUNT-IS-INVALID         VALUE 'X'.            LY005800
000580         15  RDK01-CUST-ACCT-NBR17          PIC  S9(17)   COMP-3. LY005900
000590         15  FILLER                         PIC  X(02).           LY006000
000600*                                                                   00610
000610*---------------------------------------------------------------*   00620
000620*               CUSTOMER      - DATA DICTIONARY                 *   00630
000630*---------------------------------------------------------------*   00640
000640*---------------------------------------------------------------*   00650
000650*  CUST-CONTROL-NBR                                             *   00660
000660*                -  CUSTOMER CONTROLL NUMBER (ASSIGNED BY SYS)  *   00670
000670*  CUST-ACCOUNT-NBR                                             *   00680
000680*                -  OLD CUSTOMER CHARGE ACCOUNT NUMBER          * LY006900
000690*                   (FROM CREDIT)                               * LY007000
000700*  HOME-PHONE-NBR-  HOME PHONE NUMBER                           *   00710
000710*  LAST-NAME     -  CUSTOMERS LAST NAME                         *   00720
000720*  FIRST-NAME    -  CUSTOMERS FIRST NAME                        *   00730
000730*  STREET-ADDRESS-  CUSTOMERS STREET ADDRESS                    *   00740
000740*  CITY          -  CUSTOMERS CITY OF RESIDENCE                 *   00750
000750*  STATE         -  CUSTOMERS STATE OF RESIDENCE                *   00760
000760*  ZIP-CODE      -  CUSTOMERS ZIP CODE                          *   00770
000770*  WORK-PHONE-NBR-  WORK PHONE NUMBER                           *   00780
000780*  FIRST-TRANS-DATE                                             *   00790
000790*                -  DATE OF FIRST TRANSACTION FOR THIS CUSTOMER *   00800
000800*  LAST-TRANS-DATE                                              *   00810
000810*                -  DATE OF MOST RECENT TRANSACTION             *   00820
000820*  NBR-TRANSACTIONS                                             *   00830
000830*                -  TOTAL NUMBER OF TRANSACTIONS FOR THIS CUST  *   00840
000840*  PURCHASES-TOTAL-AMT                                          *   00850
000850*                -  TOTAL DOLLAR AMOUNT OF ALL PURCHASES        *   00860
000860*  RETURNS-TOTAL-AMT                                            *   00870
000870*                -  TOTAL DOLLAR AMOUNT OF ALL RETURNS          *   00880
000880*  DIVISION      -  CREDIT SYSTEM DIVISION NUMBER FROM WHICH    *   00890
000890*                   THE NAME AND ADDRESS WAS EXTRACTED.         *   00900
000900*  CUST-ACCT-MASK                                               * LY009101
000910*                -  CUSTOMER'S LAST FOUR DIGITS OF PRIMARY      * LY009201
000920*                   ACCOUNT NUMBER.                             * LY009301
000930*  IRN-CONV-FLG                                                 * LY009401
000940*                -  INDICATES WHETHER THE ACCOUNT NUMBER IS AN  * LY009501
000950*                   IRN OR PAN.                                 * LY009601
000960*  CUST-ACCT-NBR17                                              * LY009701
000970*                -  CUSTOMER CHARGE ACCOUNT NUMBER (FROM CREDIT)* LY009801
000980*---------------------------------------------------------------*   00990
Knowing the data from Easytrieve, I believe the first CB is just header information while the second CB is the actual data

I figured out the first issue while trying to import the CB and changed the first level from 10 -> 01.

I imported both of the CB into a CFF and this is where I now find that I get the following errors:
The record ID for record <RECORD-1> is empty!
.... (repeats for operator and value)
The record ID for record <RECORD-2> is empty!
.... (repeats for operator and value)

I tried removing RECORD-1 to see what error I would get and then got this error (which was repeated for all columns in the CB):
The link column <RDK01-CUST-CONTROL-NB> cannot be found in stage columns!

Any suggestions where to start looking for the issue?

TIA
Patrick
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is your Starts in Column property set correctly?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sriven786
Participant
Posts: 37
Joined: Wed Nov 08, 2017 1:36 pm

Re: EBCDIC - multi copybooks, recordId and link col err

Post by sriven786 »

Ask your mainframe support person to do num off std and then download again so that numbers on left side will go off and make sure that 01 level record starts at 8 position.

I have removed the line numbers and removed the comments from your Cobol Copybook and could able to successfully import

01 RDK00-TRACKS. 00100
15 RDK00-FILE PIC X(03). 00110
15 RDK00-PGM-ID PIC X(03). 00120
15 RDK00-PGM-NBR PIC S9(03) COMP-3. 00130
15 RDK00-TDATE PIC S9(07) COMP-3. 00140
15 RDK00-TTIME PIC S9(07) COMP-3. 00160
15 RDK00-TCRT PIC X(04). 00180
15 RDK00-OPER. 00190
20 RDK00-INIT PIC X(02). 00200
20 RDK00-EMPNO PIC S9(09) COMP. VK090323



01 RDK01-ELEMENT. 00270
15 RDK01-KEY. 00280
20 RDK01-CUST-CONTROL-NBR PIC S9(07) COMP-3. 00290
15 RDK01-CUST-ACCOUNT-NBR PIC S9(11) COMP-3. 00310
15 RDK01-HOME-PHONE-NBR PIC S9(11) COMP-3. 00330
15 RDK01-CUSTOMER-NAME-ADDRESS. 00350
20 RDK01-LAST-NAME PIC X(25). 00360
20 RDK01-FIRST-NAME PIC X(15). 00370
20 RDK01-STREET-ADDRESS PIC X(25). 00380
20 RDK01-CITY PIC X(20). 00390
20 RDK01-STATE PIC X(02). 00400
20 RDK01-ZIP-CODE PIC 9(05). 00410
15 RDK01-WORK-PHONE-NBR PIC S9(11) COMP-3. 00430
15 RDK01-FIRST-TRANS-DATE PIC S9(09) COMP-3. 00450
15 RDK01-LAST-TRANS-DATE PIC S9(09) COMP-3. 00460
15 RDK01-NBR-TRANSACTIONS PIC S9(05) COMP-3. 00480
15 RDK01-PURCHASES-TOTAL-AMT PIC S9(07)V99 COMP-3. 00490
15 RDK01-RETURNS-TOTAL-AMT PIC S9(07)V99 COMP-3. 00500
15 RDK01-DIVISION PIC 9(02). 00520
15 RDK01-CUST-ACCT-MASK PIC S9(04) COMP-3. 00540
15 RDK01-IRN-CONV-FLG PIC X(01). LY005500
88 ACCOUNT-IS-PAN VALUE 'P'. LY005600
88 ACCOUNT-IS-IRN VALUE 'I'. LY005700
88 ACCOUNT-IS-INVALID VALUE 'X'. LY005800
15 RDK01-CUST-ACCT-NBR17 PIC S9(17) COMP-3. LY005900
15 FILLER PIC X(02). LY006000
Venkata Srini
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Follow the link in my post signature to the FAQ for using mainframe data.

From your description, you have one record definition in two parts, not a header record followed by data records. The clue there is in the descriptions. RDK00 is 26 bytes long, and RDK01 begins in position 27.

Revert the 01s to 10s, and add a 01 at the top. Reimport the CFD and use it in your CFF stage. Set the record definition to single record type.

In the meantime, you are well advised to remove comment lines before using the CFD import wizard. Also, editing the copybook text file to make sure the 01 line starts in position 8 is key. If you have one, use a text editor that is "smart", like SlickEdit. It recognizes Cobol formatting automatically.

EDIT: Also remove all 88 level lines. They are essentially comments, and you should use them in logic coding but not in the table definition.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
patrickthatcher@gmail.com
Participant
Posts: 5
Joined: Wed Nov 22, 2017 11:39 am

Post by patrickthatcher@gmail.com »

ray.wurlod wrote:Is your Starts in Column property set correctly? ...
I believe so. Here's the COBOL layout shown on Layout tab

Header

Code: Select all

Column	Picture clause	Starting column	Ending column	Storage length
01 HEADER (26)				
   02 RDK00_FILE	PIC X(3).	1	3	3
   02 RDK00_PGM_ID	PIC X(3).	4	6	3
   02 RDK00_PGM_NBR	PIC S9(3) COMP-3.	7	8	2
   02 RDK00_TDATE	PIC S9(7) COMP-3.	9	12	4
   02 RDK00_TTIME	PIC S9(7) COMP-3.	13	16	4
   02 RDK00_TCRT	PIC X(4).	17	20	4
   02 RDK00_OPER		21	26	6
     03 RDK00_INIT	PIC X(2).	21	22	2
     03 RDK00_EMPNO	PIC S9(9) COMP.
Detail

Code: Select all

Column	Picture clause	Starting column	Ending column	Storage length
01 CUST_TRANS (154)				
   02 RDK01-ELEMENT.		1	154	154
     03 RDK01-KEY.		1	4	4
       04 RDK01-CUST-CONTROL-NBR	PIC S9(7) COMP-3.	1	4	4
     03 RDK01-CUST-ACCOUNT-NBR	PIC S9(11) COMP-3.	5	10	6
     03 RDK01-HOME-PHONE-NBR	PIC S9(11) COMP-3.	11	16	6
     03 RDK01-CUSTOMER-NAME-ADDRESS.		17	108	92
       04 RDK01-LAST-NAME	PIC X(25).	17	41	25
       04 RDK01-FIRST-NAME	PIC X(15).	42	56	15
       04 RDK01-STREET-ADDRESS	PIC X(25).	57	81	25
       04 RDK01-CITY	PIC X(20).	82	101	20
       04 RDK01-STATE	PIC X(2).	102	103	2
       04 RDK01-ZIP-CODE	PIC S9(5).	104	108	5
     03 RDK01-WORK-PHONE-NBR	PIC S9(11) COMP-3.	109	114	6
     03 RDK01-FIRST-TRANS-DATE	PIC S9(9) COMP-3.	115	119	5
     03 RDK01-LAST-TRANS-DATE	PIC S9(9) COMP-3.	120	124	5
     03 RDK01-NBR-TRANSACTIONS	PIC S9(5) COMP-3.	125	127	3
     03 RDK01-PURCHASES-TOTAL-AMT	PIC S9(7)V9(2) COMP-3.	128	132	5
     03 RDK01-RETURNS-TOTAL-AMT	PIC S9(7)V9(2) COMP-3.	133	137	5
     03 RDK01-DIVISION	PIC S9(2).	138	139	2
     03 RDK01-CUST-ACCT-MASK	PIC S9(4) COMP-3.	140	142	3
     03 RDK01-IRN-CONV-FLG	PIC X(1).	143	143	1
     03 RDK01-CUST-ACCT-NBR17	PIC S9(17) COMP-3.	144	152	9
     03 FILLER	PIC X(2).	153	154	2
Total File Length: 154
I keep receiving a Record ID error. Just not sure what I'm supposed to supply.
Thanks again
sriven786
Participant
Posts: 37
Joined: Wed Nov 08, 2017 1:36 pm

Post by sriven786 »

looks like you have successfully imported the layouts and trying to read a Mainframe File with Multiple layouts. If Yes, please check with mainframe team whoever is creating how to Identify the records for multiple formats and define those in the RECORD_ID Tab and try to read it.
Venkata Srini
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

You don't have a multiple record type file. You have one record of 180 bytes.

Sorry, but you're barking up the wrong tree.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
patrickthatcher@gmail.com
Participant
Posts: 5
Joined: Wed Nov 22, 2017 11:39 am

Post by patrickthatcher@gmail.com »

Thanks FranklinE. I had left this page up over the long weekend and didn't see the other responses. Let me make the suggested changes and reimport
patrickthatcher@gmail.com
Participant
Posts: 5
Joined: Wed Nov 22, 2017 11:39 am

Post by patrickthatcher@gmail.com »

That did it. Thanks everyone
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Patrick,

The import interface with DataStage works well for Cobol, but it has a couple of flaws. The first one is that it is designed to basic, strict standards being expected, and Cobol has flavors. The second is that it tries too hard to be WYSIWYG, and doesn't quite succeed. I'm glad you didn't run into more glitches with it.

Just FYI: the original copybook design has an implicit assumption: when the record definition is copied into the code at compile, it assumes that there will be a 01 definition in front of it. That's why the copybook has 10 levels in it but no 01 levels.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply