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
READLOOP READ INFILE INTO 100
IF EOF INFILE
THEN CHKP 1 DL1
GHN ABC DL1 SEG SEGMT123 INTO 2000
IF STATUS EQ 'GE'
THEN ISRT ABC DL1 SEG=SEGMT123 FROM 100 L=1000
THEN GOTO READLOOP
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?
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
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.