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
 

 

Selcopy for Inserting record in IMS/DL1 database

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
yogeshpawar

New User


Joined: 01 Mar 2006
Posts: 37
Location: Sussex-UK

PostPosted: Tue Mar 10, 2009 4:13 am    Post subject: Selcopy for Inserting record in IMS/DL1 database
Reply with quote

Hi,

I am trying to write a selcopy which will read from INFILE and insert the records in IMS/DL1 database ABC with segment SEGMT123 having record length as 1000. I tried following

Code:
READLOOP                                                                                                   READ INFILE INTO 100                                             
          IF EOF INFILE                                                   
           THEN CHKP 1 DL1                                               
           THEN EOJ                                                       
*                                                                       
NEXTREC                                                                 
        GHN ABC DL1 SEG SEGMT123 INTO 2000                         
*                                                                       
       IF STATUS EQ 'GE'                                               
          THEN ISRT ABC DL1 SEG=SEGMT123 FROM 100  L=1000           
          THEN GOTO READLOOP                                             
       GOTO NEXTREC         


But for some reason I get select time error 576 which means segment greater than worklen but I have defined worklen as 3000. Can you please let me know whether above is correct code or do I need to make any changes in this?
Back to top
View user's profile Send private message

Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Mar 10, 2009 6:22 pm    Post subject:
Reply with quote

Where is your logic for checking status codes for the insert? Everything you do in IMS needs to be checked. For instance, I would check your read status code for spaces - if spaces get the next input record - if GE - perform the insert logic - otherwise, something is very wrong. Are you fully qualifying your SSA on your GHN? Is you database variable length - if so, you will need to set a length for your insert.
Back to top
View user's profile Send private message
Nick Jones

New User


Joined: 28 Apr 2009
Posts: 13
Location: UK

PostPosted: Wed Apr 29, 2009 4:09 pm    Post subject: Selcopy for Inserting record in IMS/DL1 database
Reply with quote

Hi yogeshpawar,

This may seem a silly question but have you actually specified a worklen ?
Your code section does not start with: OPTION WORKLEN=3000

Alternatively, you could specify worklen=3000 on your prime (1st mentioned) READ statement, although the OPTION statement is clearer.
(e.g. READ INFILE INTO 100 WORKLEN=3000 )

You should also be aware that you need to test POS STATUS not just STATUS. i.e.

Code:
IF POS STATUS  EQ  'GE'


For efficiency, you may also want to test for an end-of-file condition for your database ABC immediately following the GHN statement, i.e.

Code:
IF EOF ABC
  THEN GOTO EOJ            * End of job - no more segments.


IF EOF for a DL/1 data base is equivalent to testing STATUS code "GB".
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 -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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