MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Quikjob abended with U3336

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Oct 28, 2004 12:42 am    Post subject: Quikjob abended with U3336 Reply with quote

Hi all,
i have a file in which the first 13 bytes are of alphanumeric values and the next 4 bytes are of numeric values. The last four bytes is an error code. i am interested in extracting those records in which the error code 1015 comes immediatly after 1013 and also the first 13 bytes for the two records are the same. I wrote a quick job for this but it is abending with U3336. I tried to get some help on this abend from the manuals but couldnt find it. This is the sample input and output i want.


*************************************************************
sample input
*************************************************************

    first 13 byte next 4 byte
    ~~~~~~~~ ~~~~~~~~
    a123456789 1015
    b123456789 1015
    c123456789 1015
    eddd456789 1013
    d123456789 1013
    d123456789 1015
    e123456789 1015


*************************************************************
sample output
*************************************************************
d123456789

*************************************************************

bytes 14-17 can range from 1001 to 1020. There may or may not be 1 duplicate for first 13 bytes(not more than one if there is a duplicate present).

*************************************************************
quick job which i used for this purpose.
*************************************************************
Code:

    EQU CUSTDA INF1-13
    EQU ERRORC INF14-17
                             
                             
    EQU PCUSTDA WST1-13 ZERO
    EQU PERRORC WST14-17 ZERO
                             
200 GET INF ATEND 800
    IF ERRORC EQ C'1013'
       GOTO 250
    ELSE
       GOTO 200
    ENDIF
                             
250 IF ERRORC EQ C'1013'
    MOVE CUSTDA TO PCUSTDA
    MOVE ERRORC TO PERRORC
    GOTO 350
    ENDIF
350 GET INF ATEND 800
    IF ERRORC EQ C'1015'
      GOTO 400
    ELSE
      GOTO 200
    ENDIF
                           
400 IF CUSTDA EQ PCUSTDA
    MOVE INF1-80 TO OFA1-80
    WRITE OFA
    GET INF ATEND 800
    IF ERRORC EQ C'1013'
       GOTO 250
    ELSE
       GOTO 200
    ENDIF
 
800 GO TO EOJ
    END.

*************************************************************

This is my first quikjob. As this didnt work, i used rexx and got the result. i am attaching the rexx code also so as to make my requirement clear. Please tell me what is wrong with the quick job.
*************************************************************
rexx
*************************************************************
Code:

/******************************REXX************************/

ADDRESS TSO
   "ALLOC DD(INFL) DA('my input file') SHR REUS"
   "EXECIO * DISKR INFL ( STEM PROC. FINIS"
  ISREDIT MACRO
  CLEAR
/* TRACE ALL */
   K=0
   L=0
   ERROR_CODE = ' '
   PREV_ERROR_CODE = ' '
   CUST_DEM_APP = ' '
   PREV_CUST_DEM_APP = ' '
                                                                 
   DO I=1 TO PROC.0
      PROC.I = STRIP(PROC.I)
      ERROR_CODE= SUBSTR(PROC.I,14,4)
      CUST_DEM_APP = SUBSTR(PROC.I,1,14)
      IF ERROR_CODE = '1013' THEN
         DO
           K = K + 1
          PREV_CUST_DEM_APP = CUST_DEM_APP
          PREV_ERROR_CODE = ERROR_CODE
        END
     IF ERROR_CODE = '1015' THEN
        DO
 IF (CUST_DEM_APP = PREV_CUST_DEM_APP & PREV_ERROR_CODE = '1013') THEN
            L = L + 1
        END
  END
     SAY 'NO OF RECORDS WITH ERROR CODE 1013 IS ' K
     SAY 'NO OF REPEATED ERROR RECORDS IS       ' L

*************************************************************
Please note that in this rexx i am trying to find out the number of such cases. but in quikjob i will have to write those cases into an output file also.

thanks
bade_miya
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Thu Oct 28, 2004 8:05 am    Post subject: Reply with quote

Bademiya,

Quote:

bytes 14-17 can range from 1001 to 1020. There may or may not be 1 duplicate for first 13 bytes(not more than one if there is a duplicate present).


I am not an expert in QUIKJOB or rexx, so I managed to do it in sort. As you mentioned earlier your error code range is 1001 to 1020. And you wanted to find out if there is record with 1015 which had a an error code of 1013 in prior record.

I used the concept of summing the error code. so if we sum 1013 and 1015 we would end up with 2028. Using an include cond on the OUTFIL we can just include those records.

However a sum of 1028 can be achieved with many possible combinations such as

1008 + 1020
1009 + 1019
1010 + 1018
1011 + 1017
1012 + 1016
1013 + 1015
1014 + 1014

So we use an INCLUDE COND to eliminate the unwanted records.

try this job.

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
A123456789   1015                                           
B123456789   1015                                           
C123456789   1015                                           
EDDD456789   1013                                           
D123456789   1013                                           
D123456789   1015                                           
E123456789   1016                                           
E123456789   1012                                           
F123456789   1010                                           
F123456789   1018                                           
G123456789   1014                                           
G123456789   1014                                           
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  INCLUDE COND=(14,4,ZD,GE,1013,AND,
                14,4,ZD,NE,1014)         
  SUM FIELDS=(14,4,ZD)                                       
  SORT FIELDS=(1,13,CH,A)                                   
  OUTFIL INCLUDE=(14,4,ZD,EQ,2028),                         
  OUTREC=(1,13)                                             
/*


The output from this job is

Code:

D123456789


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Sat Oct 30, 2004 2:06 am    Post subject: Reply with quote

Hi Kolusu,
Thanks for the solution. It worked fine. When i got the problem i thought of every thing else other than sort, which turned out to be the most effective and fastest way(it took so long for rexx to process the same file). Thank you very much.

thanks
bade_miya
Back to top
View user's profile Send private message
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Sat Oct 30, 2004 6:23 am    Post subject: Reply with quote

Hi all,
Even if kolusu's solution served my purpose, i would still like to know how that ABEND occured. Please let me know if anyone knows about it..

thanks
bade_miya
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group