Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

using Alternate key in program....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kumear

New User


Joined: 24 Jan 2006
Posts: 7

PostPosted: Mon Jul 16, 2007 1:12 pm    Post subject: using Alternate key in program....
Reply with quote

Hi

I want to read(vsam ksds) dataset randomly using alternate key,and move the content into output and wirte the record in ps,but i got alternate key for example cust-name only in output other fields not moved,in execution part i used path name in input dd name. alternate index record size is 80 and also fb.

Thanks in advance...

Regards
Kumear
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jul 16, 2007 1:17 pm    Post subject:
Reply with quote

May as well start with a posting of your DD, SELECT and FD.
Additionally, the IDCAMS definition of the AIX would be nice.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Jul 16, 2007 1:17 pm    Post subject:
Reply with quote

Kumear,
Quote:
I want to read(vsam ksds) dataset randomly using alternate key,and move the content into output and wirte the record in ps,but i got alternate key for example cust-name only in output other fields not moved,in execution part i used path name in input dd name. alternate index record size is 80 and also fb.

Could you please post your code?
Back to top
View user's profile Send private message
kumear

New User


Joined: 24 Jan 2006
Posts: 7

PostPosted: Mon Jul 16, 2007 1:50 pm    Post subject: Re: using Alternate key in program....
Reply with quote

Code:

      ENVIRONMENT DIVISION.
      INPUT-OUTPUT SECTION.
      FILE-CONTROL.
                 SELECT CUST-FILE ASSIGN TO INPUT1
                    ORGANIZATION IS INDEXED
                        RECORD KEY IS CUST-NO
                          ALTERNATE KEY IS CUST-NAME
                                WITH DUPLICATES.
                  SELECT DUMMY-FILE ASSIGN TO OUTPUT1.
    DATA DIVISION.
    FILE SECTION.
    FD         CUST-FILE.
    01        CUST-REC.
                02   CUST-NO PIC X(3).
                02   CUST-NAME  PIC X(10).
                02   CUST-BAL    PIC 9(4).
                02   FILLER PIC X(63).
   


THE ABOVE CODING FOR ALT KEY,AT RUN TIME I' PASSING THE VALUE FOR ALT KEY AND READ THE RECORD AND WRITE INTO FLATE FILE.BUT I GOT ONLY CUST NAME IN OUTPUT i.e FIRST 3 COLUMNS BLANK AND THEN NAME AND LAST 4 COLUMNS BLANK .

THANKS

Regard

Kumear
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jul 16, 2007 1:59 pm    Post subject:
Reply with quote

May as well continue by the posting of your DD and the IDCAMS definition of the AIX.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon Jul 16, 2007 2:04 pm    Post subject:
Reply with quote

Also the procedure division (read, write process and if you have any other process like move in between read & write).
Back to top
View user's profile Send private message
gretchen

New User


Joined: 29 Jul 2009
Posts: 7
Location: Kansas

PostPosted: Wed Sep 30, 2009 1:16 am    Post subject: Reply to: using Alternate key in program....
Reply with quote

hi everyone,

i'm also having this problem. did this ever get resolved?
Back to top
View user's profile Send private message
gretchen

New User


Joined: 29 Jul 2009
Posts: 7
Location: Kansas

PostPosted: Wed Sep 30, 2009 1:43 am    Post subject: Reply to: using Alternate key in program....
Reply with quote

i have the following:
Code:

SELECT INPUT-FILE           ASSIGN TO  UT-S-INFILE
SELECT REPORT-FILE        ASSIGN TO  UT-S-RPT. 
SELECT FVVE-FILE            ASSIGN FVVE                         
                                      ORGANIZATION INDEXED                 
                                     ACCESS DYNAMIC                       
                                     RECORD KEY FVVE-KEY                 
                   ALTERNATE RECORD KEY IO-NAME WITH DUPLICATES
                                    STATUS FVVE-STATUS.                 

FD  FVVE-FILE                               
    LABEL RECORDS ARE STANDARD                 
    DATA RECORD IS FVVE-RECORD.               
01  FVVE-RECORD.                               
    05  FVVE-KEY.                             
        10  IO-NUMBER             PIC X(9).   
        10  IO-FILLER             PIC X(1).   
        10  IO-SFX                PIC X(2).   
    05  IO-NAME                   PIC X(40).   
    05  EXP-NAME                  PIC X(40). 

FD  REPORT-FILE                                         
    LABEL RECORDS ARE STANDARD                       
    BLOCK CONTAINS 0 RECORDS.                       
01  RPT-REC                           PIC X(133).   
                                                     
FD  INPUT-FILE                                   
    LABEL RECORDS ARE STANDARD                     
    BLOCK CONTAINS 0 RECORDS.                     
01  INPUT-REC                        PIC X(520).

WORKING-STORAGE SECTION.

01  WS-INPUT-REC.                             
    05  SUPP-NUM-1-9                  PIC X(9). 
    05  FILLER                        PIC X(22).
    05  SUPP-NAME                     PIC X(40).
    05  FILLER                        PIC X(25).
    05  ORIG-SUPP-NUM                 PIC X(31).
    05  ORIG-SUPP-NAME                PIC X(65).
    05  ADDRESS1                      PIC X(65).
    05  ADDRESS2                      PIC X(65).
    05  ADDRESS3                      PIC X(65).
    05  CITY                          PIC X(81).
    05  STATE                         PIC X(6). 
    05  FED-ID-NUM                    PIC X(11).
    05  CONFIDENCE                    PIC X(12).
    05  SUPP-CODE                     PIC X(8). 
    05  FILLER                        PIC X(15).


01  DETAIL-LINE.                                               
    05  PM-SUPP-OUT                    PIC X(15) VALUE SPACES.
    05  PM-NAME-OUT                    PIC X(45) VALUE SPACES.
    05  VE-NUMBER-OUT                  PIC X(10) VALUE SPACES.
    05  VE-SFX-OUT                     PIC X(2) VALUE SPACES. 
    05  VE-NAME-OUT                    PIC X(40) VALUE SPACES.

01  WS-MISC.                                             
    05  WS-EOF-PM                      PIC X(1) VALUE 'N'.
    05  FVVE-STATUS                    PIC X(2).         


PROCEDURE DIVISION.         
                             
100-INIT.                   
    OPEN INPUT  INPUT-FILE
                       FVVE-FILE.
    OPEN OUTPUT REPORT-FILE.     

READ INPUT-FILE                   
    AT END MOVE 'Y' TO WS-EOF-PM.   
 
MOVE INPUT-REC TO WS-INPUT-REC.

MOVE SPACES TO FVVE-RECORD.         
MOVE SUPP-NAME TO IO-NAME.         
START FVVE-FILE KEY EQUAL TO IO-NAME.

IF FVVE-STATUS = '00' OR '97' OR '02'
   MOVE ORIG-SUPP-NUM TO PM-SUPP-OUT 
   MOVE ORIG-SUPP-NAME TO PM-NAME-OUT
   MOVE IO-NAME TO VE-NAME-OUT
   MOVE IO-NUMBER TO VE-NUMBER-OUT
   MOVE IO-SFX TO VE-SFX-OUT
   MOVE 'MATCH ON NAME' TO MESSAGE-OUT
   WRITE REPORT-REC FROM DETAIL-LINE.



i'm getting everything out except info for IO-NUMBER or IO-SFX.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 30, 2009 1:45 am    Post subject:
Reply with quote

Hello,

You have replied to a topic that has been inactive for over 2 years. . .

If you would like help, you need to post your particulars and your doubt.

If you have any diagnostic info, post that as well.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us