<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic VSAM read looping infinite in Z/OS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37278#M7361</link>
    <description>Hi,&lt;BR /&gt;
Please help me in correcting the code. Our workshop has SAS under Z/OS.&lt;BR /&gt;
&lt;BR /&gt;
I have VSAM file configuration shown below:&lt;BR /&gt;
&lt;BR /&gt;
Organization: KSDS &lt;BR /&gt;
KSDS key length: 4 &lt;BR /&gt;
KSDS key location: 0 &lt;BR /&gt;
Average record size: 80 &lt;BR /&gt;
Maximum record size: 80 &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here is the sample output from the file:&lt;BR /&gt;
&lt;BR /&gt;
---- +----1----+----2-&lt;BR /&gt;
**********************&lt;BR /&gt;
1234 saikrishna &lt;BR /&gt;
1235 xxxxxxxxxx &lt;BR /&gt;
&lt;BR /&gt;
Here is the code I used to access key 1235&lt;BR /&gt;
&lt;BR /&gt;
DATA FILEIN; &lt;BR /&gt;
ID='1235'; &lt;BR /&gt;
KEYVAR= ID; &lt;BR /&gt;
INFILE INFIL VSAM KEY=KEYVAR; &lt;BR /&gt;
INPUT &lt;BR /&gt;
@5 NAME $CHAR12.; &lt;BR /&gt;
; &lt;BR /&gt;
PROC PRINT DATA=FILEIN; &lt;BR /&gt;
; &lt;BR /&gt;
&lt;BR /&gt;
The Mainframe batch job keep on running for ever.. I cancelled the job and added the code IF _N_ &amp;gt; 100 THEN STOP; then I noticed the logic is reading the same record again and again (in the output it has 100 records same).&lt;BR /&gt;
&lt;BR /&gt;
Could you please suggest me the code to handle this situation?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Sai &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
PS:  Yesterday I posted this topic in  SAS Enterprise Guide  thread. I do not have access to remove my topic  there. I request Admin to remove topic from that thread.</description>
    <pubDate>Thu, 07 Aug 2008 14:12:35 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-08-07T14:12:35Z</dc:date>
    <item>
      <title>VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37278#M7361</link>
      <description>Hi,&lt;BR /&gt;
Please help me in correcting the code. Our workshop has SAS under Z/OS.&lt;BR /&gt;
&lt;BR /&gt;
I have VSAM file configuration shown below:&lt;BR /&gt;
&lt;BR /&gt;
Organization: KSDS &lt;BR /&gt;
KSDS key length: 4 &lt;BR /&gt;
KSDS key location: 0 &lt;BR /&gt;
Average record size: 80 &lt;BR /&gt;
Maximum record size: 80 &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Here is the sample output from the file:&lt;BR /&gt;
&lt;BR /&gt;
---- +----1----+----2-&lt;BR /&gt;
**********************&lt;BR /&gt;
1234 saikrishna &lt;BR /&gt;
1235 xxxxxxxxxx &lt;BR /&gt;
&lt;BR /&gt;
Here is the code I used to access key 1235&lt;BR /&gt;
&lt;BR /&gt;
DATA FILEIN; &lt;BR /&gt;
ID='1235'; &lt;BR /&gt;
KEYVAR= ID; &lt;BR /&gt;
INFILE INFIL VSAM KEY=KEYVAR; &lt;BR /&gt;
INPUT &lt;BR /&gt;
@5 NAME $CHAR12.; &lt;BR /&gt;
; &lt;BR /&gt;
PROC PRINT DATA=FILEIN; &lt;BR /&gt;
; &lt;BR /&gt;
&lt;BR /&gt;
The Mainframe batch job keep on running for ever.. I cancelled the job and added the code IF _N_ &amp;gt; 100 THEN STOP; then I noticed the logic is reading the same record again and again (in the output it has 100 records same).&lt;BR /&gt;
&lt;BR /&gt;
Could you please suggest me the code to handle this situation?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Sai &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
PS:  Yesterday I posted this topic in  SAS Enterprise Guide  thread. I do not have access to remove my topic  there. I request Admin to remove topic from that thread.</description>
      <pubDate>Thu, 07 Aug 2008 14:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37278#M7361</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-07T14:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37279#M7362</link>
      <description>Provide the SASLOG output, and add OPTIONS OBS=0; to your SAS program for short-circuit execution.&lt;BR /&gt;
&lt;BR /&gt;
Also, another possibility to increase diagnostics, add some PUT _ALL_; statements (or PUTLOG in SAS 9) to help determine what is happening with the DATA step.&lt;BR /&gt;
&lt;BR /&gt;
Also, are you getting CPU time and is there I/O activity -- information available from your JOB OUTPUT and from your batch job monitor (like SDSF)?&lt;BR /&gt;
&lt;BR /&gt;
Has this particular code worked in the past or is it the first attempt?  And are you able to access the same file, say with IDCAMS?&lt;BR /&gt;
&lt;BR /&gt;
Helplful diagnostics in order to get to the bottom.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 07 Aug 2008 17:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37279#M7362</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-07T17:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37280#M7363</link>
      <description>Also, I searched the SAS support website &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt; and found this support tech note that may apply:&lt;BR /&gt;
&lt;BR /&gt;
Problem Note 30979: Performance degradation might occur in SAS®9 if you process VSAM files on a Remote Library Services (RLS) server&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/30/979.html" target="_blank"&gt;http://support.sas.com/kb/30/979.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Have your SAS admin investigate the SAS 9 HOTFIX website for the associated maintenance (mind any broken URLs):&lt;BR /&gt;
&lt;BR /&gt;
ftp://ftp.sas.com/techsup/download/hotfix/e9_sbcs_prod_list.html&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 07 Aug 2008 17:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37280#M7363</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-07T17:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37281#M7364</link>
      <description>Thanks so much for responding..  Please see my answer to your queries....&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Provide the SASLOG output, and add OPTIONS OBS=0; to your SAS program for short-circuit execution&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: This installation is running Base SAS hot fix bundle 82BX06.     &lt;BR /&gt;
                                                                       &lt;BR /&gt;
  Welcome to the SAS Information Delivery System,                      &lt;BR /&gt;
                                                                       &lt;BR /&gt;
        888       888     Release 8.2!                                 &lt;BR /&gt;
       8   8     8   8                                                 &lt;BR /&gt;
       8   8         8                                                 &lt;BR /&gt;
        8 8          8    This message displays in the SAS log when    &lt;BR /&gt;
         8          8     the NEWS option is specified. You can        &lt;BR /&gt;
  88    8 8        8      replace it with your own message by editing  &lt;BR /&gt;
 8  8  8   8      8       the NEWS file.                               &lt;BR /&gt;
 8     8   8  8  8                                                     &lt;BR /&gt;
 8      888   8  88888                                                 &lt;BR /&gt;
                                                                       &lt;BR /&gt;
                                                                       &lt;BR /&gt;
                                                                       &lt;BR /&gt;
NOTE: The SASUSER library was not specified. SASUSER library will now b&lt;BR /&gt;
NOTE: All data sets and catalogs in the SASUSER library will be deleted&lt;BR /&gt;
      prevent their deletion.                                          &lt;BR /&gt;
                                                                       &lt;BR /&gt;
NOTE: SAS system options specified are:                                &lt;BR /&gt;
      SORT=4                                                           &lt;BR /&gt;
 NOTE: The initialization phase used 0.04 CPU seconds and 5453K.       &lt;BR /&gt;
 1            OPTIONS OBS=0;                                           &lt;BR /&gt;
 2            DATA FILEIN;                                             &lt;BR /&gt;
 3            ID='1235';                                               &lt;BR /&gt;
 4            KEYVAR= ID;                                              &lt;BR /&gt;
 5            INFILE INFIL VSAM KEY=KEYVAR;                            &lt;BR /&gt;
 6            INPUT                                                    &lt;BR /&gt;
 7             @5     NAME    $CHAR12.;                                &lt;BR /&gt;
 8            ;                                                        &lt;BR /&gt;
                                                                       &lt;BR /&gt;
 NOTE: The infile INFIL is:                                            &lt;BR /&gt;
       Dsname=BCST.SAI.TEST,                                           &lt;BR /&gt;
       Volume=CGNP6H,Disp=SHR,Unit=3390,Type=INDEXED,                  &lt;BR /&gt;
12                                                          The SAS Sys&lt;BR /&gt;
                                                                       &lt;BR /&gt;
       Spanned=NO,Recordsize=(.,80),Amp=('AMORG'),                     &lt;BR /&gt;
       Records=2,Keys=(4 0)                                            &lt;BR /&gt;
                                                                       &lt;BR /&gt;
 NOTE: 0 records were read from the infile INFIL.                      &lt;BR /&gt;
 NOTE: The data set WORK.FILEIN has 0 observations and 2 variables.    &lt;BR /&gt;
 NOTE: The DATA statement used 0.03 CPU seconds and 7233K.             &lt;BR /&gt;
                                                                       &lt;BR /&gt;
9           PROC PRINT DATA=FILEIN;                                    &lt;BR /&gt;
10           ;                                                         &lt;BR /&gt;
NOTE: No observations in data set WORK.FILEIN.                         &lt;BR /&gt;
NOTE: The PROCEDURE PRINT used 0.01 CPU seconds and 8044K.             &lt;BR /&gt;
                                                                       &lt;BR /&gt;
NOTE: The SAS session used 0.08 CPU seconds and 8044K.                 &lt;BR /&gt;
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414    &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Also, another possibility to increase diagnostics, add some PUT _ALL_; statements (or PUTLOG in SAS 9) to help determine what is happening with the DATA step.&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=1   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=2   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=3   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=4   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=5   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=6   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=7   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=8   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=9   &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=10  &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=11  &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=12  &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=13  &lt;BR /&gt;
ID=1235 KEYVAR=1235 _RBA_=80 _FDBK_=0 _RRN_=0 NAME=xxxxxxxxxx _ERROR_=0 _N_=14  &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
This is keep on going.. until I cancel the job..&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Also, are you getting CPU time and is there I/O activity -- information available from your JOB OUTPUT and from your batch job monitor (like SDSF)?&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
I am seeing I/O activity&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;Has this particular code worked in the past or is it the first attempt? And are you able to access the same file, say with IDCAMS?&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
This is our first attempt to process VSAM file. When I access the same file without key option, the code worked perfect. With KEY option, the program is looping</description>
      <pubDate>Thu, 07 Aug 2008 17:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37281#M7364</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-07T17:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37282#M7365</link>
      <description>Not sure what else to offer for diagnosing the problem, presuming the following DOC will not provide additional insight for your interest:&lt;BR /&gt;
&lt;BR /&gt;
SAS Guide to VSAM Processing (Version 8):&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/base/vsam.pdf" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/base/vsam.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Perhaps you have some other colleagues who use and/or maintain this VSAM file, and you can collaborate with them on your quest.&lt;BR /&gt;
&lt;BR /&gt;
Good luck.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 07 Aug 2008 18:48:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37282#M7365</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-07T18:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37283#M7366</link>
      <description>Am I missing something?  You are reading a keyed VSAM file and you never change the key and you are constantly getting the same record.  If you don't change the key, why should you get a different record?</description>
      <pubDate>Tue, 12 Aug 2008 21:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37283#M7366</guid>
      <dc:creator>esirjhm</dc:creator>
      <dc:date>2008-08-12T21:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37284#M7367</link>
      <description>Great!... Thanks a lot... please correct my code. What should I add to stop as soon as reading the key?</description>
      <pubDate>Wed, 13 Aug 2008 01:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37284#M7367</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-13T01:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37285#M7368</link>
      <description>Hi:&lt;BR /&gt;
  The documentation is quite clear on the subject and has very good examples. See this link and READ the documentation. &lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/onlinedoc/base/vsam.pdf" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/base/vsam.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
You have to know whether you have a KSDS, ESDS or RRDS type of VSAM file in order to use the appropriate method in your code.&lt;BR /&gt;
&lt;BR /&gt;
It is almost impossible for anyone to help you unless you understand what type of VSAM file you have and what type of read you want to do: sequential, or addressed direct access or direct address with alternate keys or skip sequential access or with read by relative record numbers.&lt;BR /&gt;
 &lt;BR /&gt;
Probably your best bet for help is to gather as much information about the VSAM file using documentation at your site and then contacting Tech Support for more help.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 13 Aug 2008 02:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37285#M7368</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-08-13T02:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37286#M7369</link>
      <description>Cynthia has a link to the documentation and it's good and you should read it, but here is something to play with while you are reading.  This job creates a VSAM file and populates it with two records.  And reads them back.  Successfully.   I get a condition code of zero, but I also get a diagnostic in SYSLOG and I'm not entirely sure what it is telling me:&lt;BR /&gt;
&lt;BR /&gt;
ALL RECORDS READ                                                           &lt;BR /&gt;
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+&lt;BR /&gt;
3          0                                                               &lt;BR /&gt;
GENKEY=  FDBK=4 _RBA_=80 _FDBK_=4 _RRN_=0 KEYIN=22345 DATAN=SECOND RECORD _&lt;BR /&gt;
NOTE: 2 records were read from the infile VSAMFILE.                        &lt;BR /&gt;
&lt;BR /&gt;
In any case, if I can figure out what causes the diagnostic I'll be back.  I haven't used VSAM in years.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
//ESIRJHM6 JOB (6021,JHM,125,1500),CSECT,MSGCLASS=R,CLASS=4,       &lt;BR /&gt;
// TIME=NOLIMIT TYPRUN=SCAN                                        &lt;BR /&gt;
//IDCAMS   EXEC PGM=IDCAMS                                         &lt;BR /&gt;
//REPRO    DD *                                                    &lt;BR /&gt;
12345 FIRST  RECORD                                                &lt;BR /&gt;
22345 SECOND RECORD                                                &lt;BR /&gt;
//SYSPRINT DD SYSOUT=*                                             &lt;BR /&gt;
//SYSIN    DD *                                                    &lt;BR /&gt;
 DELETE 'ESIRJHM.VSAM.DATA'                                        &lt;BR /&gt;
                                                                   &lt;BR /&gt;
 DEFINE CLUSTER -                                                  &lt;BR /&gt;
          (NAME('ESIRJHM.VSAM.DATA') -                             &lt;BR /&gt;
           STORCLAS(ADVANCED) -                                    &lt;BR /&gt;
           MGMTCLAS(STANDARD) -                                    &lt;BR /&gt;
           CYL(2 1) -                                              &lt;BR /&gt;
           KEYS(05 0)-                                             &lt;BR /&gt;
           RECSZ(80 80))                                           &lt;BR /&gt;
 REPRO ODS(ESIRJHM.VSAM.DATA) IFILE(REPRO)                         &lt;BR /&gt;
 VERIFY DATASET(ESIRJHM.VSAM.DATA)                                 &lt;BR /&gt;
 SET MAXCC = 0                                                     &lt;BR /&gt;
//SAS      EXEC SAST                                               &lt;BR /&gt;
//VSAMFILE DD DISP=SHR,DSN=ESIRJHM.VSAM.DATA                     &lt;BR /&gt;
//SYSIN    DD *                                                  &lt;BR /&gt;
 OPTIONS NOCENTER;                                               &lt;BR /&gt;
 DATA _NULL_;                                                    &lt;BR /&gt;
 LENGTH GENKEY $5;                                               &lt;BR /&gt;
 FDBK = 0;                                                       &lt;BR /&gt;
 GENKEY = ' ';                                                   &lt;BR /&gt;
 INFILE VSAMFILE VSAM FEEDBACK=FDBK KEY=GENKEY GENKEY SKIP       &lt;BR /&gt;
        KEYGE;                                                   &lt;BR /&gt;
 DO WHILE (FDBK = 0);                                            &lt;BR /&gt;
    INPUT @;                                                     &lt;BR /&gt;
    IF FDBK = 0 THEN DO;                                         &lt;BR /&gt;
       INPUT @01 KEYIN   $5.                                     &lt;BR /&gt;
             @06 DATAN   $75.;                                   &lt;BR /&gt;
       PUTLOG _INFILE_;                                          &lt;BR /&gt;
    END;                                                         &lt;BR /&gt;
 END;                                                            &lt;BR /&gt;
 PUTLOG 'ALL RECORDS READ';                                      &lt;BR /&gt;
 STOP;                                                           &lt;BR /&gt;
 RUN;</description>
      <pubDate>Wed, 13 Aug 2008 14:33:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37286#M7369</guid>
      <dc:creator>esirjhm</dc:creator>
      <dc:date>2008-08-13T14:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37287#M7370</link>
      <description>Your end-of-file PUTLOG generated part of the diagnostic with the _INFILE_;&lt;BR /&gt;
&lt;BR /&gt;
Simplify your DATA step by removing the DO loop.  If you need to test FDBK, conditionally output if FDBK=0, and then use END=EOF DO/THEN if you need to generate some SASLOG end-of-processing messages.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 13 Aug 2008 16:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37287#M7370</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-13T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37288#M7371</link>
      <description>Scott,&lt;BR /&gt;
&lt;BR /&gt;
I have pared the program down to this:&lt;BR /&gt;
OPTIONS NOCENTER;                                                &lt;BR /&gt;
DATA _NULL_;                                                     &lt;BR /&gt;
RETAIN GENKEY  '     ';                                          &lt;BR /&gt;
INFILE VSAMFILE VSAM FEEDBACK=FDBK KEY=GENKEY GENKEY SKIP END=END&lt;BR /&gt;
       KEYGE;                                                    &lt;BR /&gt;
INPUT @01 KEYIN   $5.                                            &lt;BR /&gt;
      @06 DATAN   $75.;                                          &lt;BR /&gt;
IF END THEN STOP;                                                &lt;BR /&gt;
PUTLOG FDBK =;                                                   &lt;BR /&gt;
IF FDBK = 0 THEN PUTLOG _INFILE_;                                &lt;BR /&gt;
ELSE STOP;                                                       &lt;BR /&gt;
RUN;                                                             &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I still get the following diagnostic (though the return code is zero). &lt;BR /&gt;
&lt;BR /&gt;
FDBK=4                                                                         &lt;BR /&gt;
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----&lt;BR /&gt;
3          0                                                                   &lt;BR /&gt;
2 The SAS System                                                               &lt;BR /&gt;
                                                                               &lt;BR /&gt;
GENKEY=  _RBA_=80 _FDBK_=4 _RRN_=0 FDBK=4 END=0 KEYIN=  DATAN=  _ERROR_=1 _INFI&lt;BR /&gt;
&lt;BR /&gt;
Where is the third record coming from.  &lt;BR /&gt;
&lt;BR /&gt;
Why don't you just change the code to show me how to prevent this diagnostic.</description>
      <pubDate>Thu, 14 Aug 2008 12:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37288#M7371</guid>
      <dc:creator>esirjhm</dc:creator>
      <dc:date>2008-08-14T12:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37289#M7372</link>
      <description>Frankly, how do you expect to learn, otherwise.  Attaining an reputation as "experienced SAS programmer extraordinaire" through a burn-in phase requires self-diagnostic iteration -- something more than just trolling the Internet forums, I'd suggest.  It's your program, your input data, your information processing requirement, programming composition, etc., therefore I encourage you to gain from what you learn here and go-forward.  Others may have their own opinions and are free to share.  I tend to guide rather than push.&lt;BR /&gt;
&lt;BR /&gt;
To that end, I suggest you investigate each of your INFILE statement parameters, pare down your SAS code to the bare minimum, and run various GENKEY value scenarios, in order to learn from the SAS VSAM programming/processing behavior.&lt;BR /&gt;
&lt;BR /&gt;
Good luck.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Thu, 14 Aug 2008 14:27:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37289#M7372</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-08-14T14:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: VSAM read looping infinite in Z/OS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37290#M7373</link>
      <description>Thanks so much for your replies.. I corrected the code, working fine..&lt;BR /&gt;
&lt;BR /&gt;
//STEP0001 EXEC SAS                                                     &lt;BR /&gt;
//INFIL    DD DISP=SHR,DSN=XXXXX.SAI.TEST                                &lt;BR /&gt;
//SYSIN    DD  *                                                        &lt;BR /&gt;
  DATA FILEIN;                                                          &lt;BR /&gt;
  ID='1235';                                                            &lt;BR /&gt;
  KEYVAR= ID;                                                           &lt;BR /&gt;
  INFILE INFIL VSAM KEY=KEYVAR FEEDBACK=CHK1;                           &lt;BR /&gt;
  INPUT                                                                 &lt;BR /&gt;
   @5     NAME    $CHAR12.;                                             &lt;BR /&gt;
  PUT _ALL_;                                                            &lt;BR /&gt;
  IF CHK1 = 0 THEN DO;                                                  &lt;BR /&gt;
     OUTPUT;                                                            &lt;BR /&gt;
     STOP;                                                              &lt;BR /&gt;
     END;                                                               &lt;BR /&gt;
  ELSE DO;                                                              &lt;BR /&gt;
     PUT 'RECORD NOT FOUND..'                                           &lt;BR /&gt;
     STOP;                                                              &lt;BR /&gt;
  END;                                                                  &lt;BR /&gt;
  RUN;                                                                  &lt;BR /&gt;
 PROC PRINT DATA=FILEIN;                                                &lt;BR /&gt;
  ;                                                    &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The one option preventing from infinite loop is FEEDBACK check. One mystery still remaining is why SAS reading again and again same record for direct access using KSDS (example shown beginning of the topic)</description>
      <pubDate>Tue, 19 Aug 2008 14:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/VSAM-read-looping-infinite-in-Z-OS/m-p/37290#M7373</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-08-19T14:57:08Z</dc:date>
    </item>
  </channel>
</rss>

