IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can i retrieve the batch name for each detail record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Sat Nov 22, 2008 9:38 pm
Reply with quote

LRECL is 94 and format is fb
Should Tat be VB
Size of batch name is 16
INVALID ACCOUNT NO starts at position 36
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Sat Nov 22, 2008 9:42 pm
Reply with quote

ya it always appears at 7th record starts at position 36
It won't vary
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Nov 22, 2008 10:10 pm
Reply with quote

Edwin,

The easiest way to do this would be with the WHEN=GROUP function of DFSORT, available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008), like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (FB/94)
//SORTOUT DD DSN=...  output file (FB/94)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=94,
   IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'5'),
    PUSH=(95:5,16)),
   IFTHEN=(WHEN=(1,1,CH,EQ,C'7'),OVERLAY=(36:95,16,6X))
/*


However, I can see from the messages you posted that you don't have this PTF. Ask your System Programmer to install it.

You can do what you want without WHEN=GROUP in a slightly more complicated way (though not as complicated as the "solution" Sambhaji proposed), like this:

Code:

//S1    EXEC  PGM=ICETOOL                                           
//TOOLMSG   DD  SYSOUT=*                                           
//DFSMSG    DD  SYSOUT=*                                           
//IN DD DSN=...  input file (FB/94)
//OUT DD DSN=...  output file (FB/94)                               
//TOOLIN  DD    *                                                   
SPLICE FROM(IN) TO(OUT) ON(95,8,ZD) KEEPBASE WITHALL -             
  WITH(1,94) USING(CTL1)               
/*                           
//CTL1CNTL DD *                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(95:SEQNUM,8,ZD)),               
        IFTHEN=(WHEN=(1,1,CH,EQ,C'5'),                             
                OVERLAY=(95:SEQNUM,8,ZD,111:5,16)),                 
        IFTHEN=(WHEN=NONE,                                         
                OVERLAY=(103:SEQNUM,8,ZD,                           
                         95:95,8,ZD,SUB,103,8,ZD,TO=ZD,LENGTH=8))   
  OUTFIL FNAMES=OUT,                                               
   IFOUTLEN=94,                                                     
   IFTHEN=(WHEN=(1,1,CH,EQ,C'7'),OVERLAY=(36:111,16,6X))           
/*
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Mon Nov 24, 2008 10:09 am
Reply with quote

@ Frank

It worked well thanks for ur help

Can this same functionality be achieved by a simple SORT
Just want to know

@ all
thanks for all ur responses
keep rocking

regards
edwin
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Nov 24, 2008 9:58 pm
Reply with quote

Quote:
Can this same functionality be achieved by a simple SORT
Just want to know


I don't know what you mean by a "simple SORT". If you mean by a DFSORT step, rather than an ICETOOL step, then the WHEN=GROUP step I showed above meets that criteria.

If you're thinking that there's a difference between using PGM=ICEMAN and PGM=SORT, there isn't. They are equivalent.

If that doesn't answer your question, then explain more clearly what you mean by a "simple SORT" (and why it matters).
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Tue Nov 25, 2008 8:24 am
Reply with quote

@ Frank

Ya i meant it as DFSORT
Can it be done in DFSORT i compiled the code and it gave syntax errors
Here people feel it would be better if its SORT step rather than ICEMAN step if so how to proceed further to put the same using DFSORT

regards
Edwin
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Nov 25, 2008 9:08 am
Reply with quote

Hello,

ICEMAN and SORT execute the same load module. . . What works in one works in the other unless someone has "broken" your configuration.

Quote:
Can it be done in DFSORT i compiled the code and it gave syntax errors
If you post the jcl, control statements, and the complete diagnostic info including the message ids, we will be able to explain the error(s).
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Tue Nov 25, 2008 9:16 am
Reply with quote

JCL :

Code:
//S1    EXEC  PGM=SORT                                       
//SYSOUT    DD  SYSOUT=*                                     
//SORTIN DD DSN=SSY2335.USER.REJECT.FILE2,DISP=SHR           
//SORTOUT DD DSN=SSY2335.MAN.REJECT,DISP=(NEW,CATLG,DELETE) 
//SYSIN    DD    *                                           
  OPTION COPY                                               
  INREC IFOUTLEN=94,                                         
   IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'5'),               
    PUSH=(95:5,16)),                                         
   IFTHEN=(WHEN=(1,1,CH,EQ,C'7'),OVERLAY=(36:95,16,6X))     
/* 


Control statement is as follows

Code:
0 BLOCKSET     COPY  TECHNIQUE SELECTED                             
 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES
 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 21:46 ON MON
     OPTION COPY                                                     
     INREC IFOUTLEN=94,                                               
      IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'5'),                     
                   $                                                 
 0 SYNTAX ERROR                                                       
       PUSH=(95:5,16)),                                               
       $                                                             
 0 STATEMENT DEFINER ERROR                                           
      IFTHEN=(WHEN=(1,1,CH,EQ,C'7'),OVERLAY=(36:95,16,6X))           
      $                                                               
 0 STATEMENT DEFINER ERROR                                           
 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705                 
 3 END OF DFSORT   


regards
edwin
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Nov 25, 2008 9:35 am
Reply with quote

Hello,

My guess is that your system does not have the ptf from July installed.

What happens if you use the second example that Frank provided?
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Tue Nov 25, 2008 10:11 am
Reply with quote

@dick

second example works fine with ICETOOL
will that be possible to be implemented in DFSORT
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Nov 25, 2008 9:48 pm
Reply with quote

Edwin,

The first example uses DFSORT (PGM=SORT or PGM=ICEMAN - they are equivalent). It requires z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If your System Programmer installs that PTF, you can use that example.

The second example uses DFSORT's ICETOOL (PGM=ICETOOL). It does NOT require that PTF.

Quote:
second example works fine with ICETOOL
will that be possible to be implemented in DFSORT


ICETOOL is part of DFSORT. It has been since 1991! ICETOOL is available to you, and you said the ICETOOL job works fine, so what's the problem?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
Search our Forums:

Back to Top