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
 

 

How can i retrieve the batch name for each detail record
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Thu Nov 20, 2008 5:16 pm    Post subject: How can i retrieve the batch name for each detail record
Reply with quote

Hi can any one help with these

i have a file where the records are as follows

1
5 this is a batch header wer i hav ( batch name)
6 this is detail record
7 same detail of above record continued
8batch trailer
5another new batch header with a new name
6another detailed record
7
6another detailed record
7
6
7
6
7
8
9

How can i retrieve the batch name for each detail record
the problem is the each detail records are sorted on some other basis

i have used this file and sorted and processed it further to write a report
without much changes to the program can any one suggest me a
easy way to get the coressponding batch name for all detail records.
using sort or any other means
i cant write a new program to get that batch name and
then sort it and another program to process and write a new report.
Back to top
View user's profile Send private message

kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Thu Nov 20, 2008 5:44 pm    Post subject:
Reply with quote

Hi edwin,

Quote:
the problem is the each detail records are sorted on some other basis


Could you pls elaborate on this...

Quote:
1
5 this is a batch header wer i hav ( batch name)
6 this is detail record
7 same detail of above record continued
8batch trailer
5another new batch header with a new name
6another detailed record
7
6another detailed record
7
6


what i assumed from you post is.. The i/p file is of the format u mentioned with record type number. From the record type no. u can distinguish it from the other records. so while processing if find a match on type 5 get the header to a group variable(structure of header) and find the batch name.

we can help you if we understand ur question correctly...

regards,
Kratos
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Thu Nov 20, 2008 9:29 pm    Post subject: Reply to: How can i retrieve the batch name for each detail
Reply with quote

I sort the 6 & 7 record type based on another field
Ie
622
799
622
799

627
799
627
799

And I will process these two files to write two categories in a report
Now I need corresponding batch name
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Nov 21, 2008 3:13 am    Post subject:
Reply with quote

Hello Edwin and welcome to the forum,

To help us help you, you need to post more realistic sample input, the output you currently get from that input, and what additional output you want - either in another file or in the current output.

Are you using an internal sort currently?

Once you better describe the requirement, someone may be able to help.
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Fri Nov 21, 2008 10:50 am    Post subject: Reply to: How can i retrieve the batch name for each detail
Reply with quote

Hi all,
before going deep into the requirement first help up with these
the input and output files are as follows
Need to do insert the batch name (ex Edwin) in each of its detail records
in place of invalid account no .usign sort or iceman or any other means but not a program as i further sort this file and process to write a report

I/P file

101 03110020921124181910008110738H094101INNNNDINIDD, N.A.
5200edwin 2390526440PPDDEPOSIT
6210311002095010000005764996A0000050004 SBM DDA
799R04020083030505426 03110020INVALID ACCOUNT NUMBER
6210311002095010000005765089B0000052504 SBM DDA
799R04020083030505427 03110020INVALID ACCOUNT NUMBER
820000000400062200400000000000000000001025081132518466
5200MEshak 2390526440PPDDEPOSIT
6260311002095010000005765495D0000062504 SBM DDA
799R04020083030505429 03110020INVALID ACCOUNT NUMBER
820000000200031100200000000625040000000000001132518466



Output :

101 03110020921124181910008110738H094101INNNNDINIDD, N.A.
5200edwin 2390526440PPDDEPOSIT
6210311002095010000005764996A0000050004 SBM DDA
799R04020083030505426 03110020edwin
6210311002095010000005765089B0000052504 SBM DDA
799R04020083030505427 03110020edwin
820000000400062200400000000000000000001025081132518466
5200MEshak 2390526440PPDDEPOSIT
6260311002095010000005765495D0000062504 SBM DDA
799R04020083030505429 03110020 MEshak
820000000200031100200000000625040000000000001132518466
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Nov 21, 2008 11:03 am    Post subject:
Reply with quote

For such requirement, I would suggest to use SORT in jcl instead of processing from COBOL program (if possible)

Quote:
i have used this file and sorted and processed it further to ...



Please post actual input before sort too along with final desired output.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Nov 21, 2008 11:12 am    Post subject:
Reply with quote

Quote:
but not a program as i further sort this file

And how that output will look like?
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Fri Nov 21, 2008 11:29 am    Post subject:
Reply with quote

@ Sambhaji

Am using a Sort in Jcl only
further input file is same as below

101 03110020921124181910008110738H094101INNNNDINIDD, N.A.
5200edwin 2390526440PPDDEPOSIT
6210311002095010000005764996A0000050004 SBM DDA
799R04020083030505426 03110020INVALID ACCOUNT NUMBER
6210311002095010000005765089B0000052504 SBM DDA
799R04020083030505427 03110020INVALID ACCOUNT NUMBER
820000000400062200400000000000000000001025081132518466
5200MEshak 2390526440PPDDEPOSIT
6260311002095010000005765495D0000062504 SBM DDA
799R04020083030505429 03110020INVALID ACCOUNT NUMBER
820000000200031100200000000625040000000000001132518466

i Just want to inser each of these batch names in each of the detail records particulary inside tat batch

I do SORT these files further to process to write a report based on another
field where i do need to retrive the corresponding batch name.
The problem is i have sorted it.
either tel me a way to insert the name in each batch using some sort techniques so it wil be easy to retrive.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Nov 21, 2008 1:11 pm    Post subject:
Reply with quote

Quote:
@ Sambhaji

Am using a Sort in Jcl only

I got confused because it is posted in COBOL forum.
Try this one
Code:

//S1   EXEC  PGM=ICETOOL                                         
//TOOLMSG   DD  SYSOUT=*                                         
//DFSMSG    DD  SYSOUT=*                                         
//INP1  DD *                                                     
101 03110020921124181910008110738H094101INNNNDINIDD, N.A.         
5200EDWIN 2390526440PPDDEPOSIT                                   
6210311002095010000005764996A0000050004 SBM DDA                   
799R04020083030505426 03110020INVALID ACCOUNT NUMBER             
6210311002095010000005765089B0000052504 SBM DDA                   
799R04020083030505427 03110020INVALID ACCOUNT NUMBER             
820000000400062200400000000000000000001025081132518466           
5200MESHAK 2390526440PPDDEPOSIT                                   
6260311002095010000005765495D0000062504 SBM DDA                   
799R04020083030505429 03110020INVALID ACCOUNT NUMBER             
820000000200031100200000000625040000000000001132518466   
/*                                                       
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=EX.DEX006.OFILE,DISP=(MOD,CATLG,DELETE)     
//TOOLIN DD *                                             
   COPY FROM(INP1) TO(T1) USING(CTL1)                     
   COPY FROM(INP1) TO(OUT1) USING(CTL2)                   
   SPLICE FROM(T1) TO(OUT1) ON(91,8,ZD) -                 
   WITHALL WITH(1,80) KEEPBASE USING(CTL3)               
/*                                                       
//CTL1CNTL DD *                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(91:SEQNUM,8,ZD)),     
  IFTHEN=(WHEN=(1,4,CH,EQ,C'5200'),                       
  OVERLAY=(81:5,6,91:SEQNUM,8,ZD)),                       
  IFTHEN=(WHEN=NONE,                                     
  OVERLAY=(99:SEQNUM,8,ZD,                               
  91:91,8,ZD,SUB,99,8,ZD,M11,LENGTH=8))                         
/*                                                             
//CTL2CNTL DD *                                                 
  OPTION COPY,STOPAFT=1                                         
/*                                                             
//CTL3CNTL DD *                                                 
  OUTFIL IFTHEN=(WHEN=(31,22,CH,EQ,C'INVALID ACCOUNT NUMBER'), 
                 BUILD=(1,30,31:81,6,37:16X,53:53,28)),         
         IFTHEN=(WHEN=NONE,BUILD=(1,80)),                       
         FNAMES=OUT1                                           
/*                                                             
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Fri Nov 21, 2008 2:32 pm    Post subject:
Reply with quote

E RECORD TYPE IS F - DATA STARTS IN POSITION 1
1 END OF FIELD BEYOND MAXIMUM RECORD LENGTH

this error occurs while i try running it
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Nov 21, 2008 2:54 pm    Post subject:
Reply with quote

Above is tested solution.
Post your JCL here.
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Fri Nov 21, 2008 3:00 pm    Post subject:
Reply with quote

//SSY2335D JOB (TEST),'REJ REPT',NOTIFY=&SYSUID,CLASS=F,
// MSGLEVEL=(1,1),MSGCLASS=X,TIME=NOLIMIT
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INP1 DD DSN=SSY2335.USER.REJECT.FILE2,DISP=SHR
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=SSY2335.NEW.REJECT,DISP=(MOD,CATLG,DELETE)
//TOOLIN DD *
COPY FROM(INP1) TO(T1) USING(CTL1)
COPY FROM(INP1) TO(OUT1) USING(CTL2)
SPLICE FROM(T1) TO(OUT1) ON(95,8,ZD) -
WITHALL WITH(1,94) KEEPBASE USING(CTL3)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(95:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,2,CH,EQ,C'52'),
OVERLAY=(103:5,16,95:SEQNUM,8,ZD)),
IFTHEN=(WHEN=NONE,
OVERLAY=(119:SEQNUM,8,ZD,
95:95,8,ZD,SUB,119,8,ZD,M11,LENGTH=8))
/*
//CTL2CNTL DD *
OPTION COPY,STOPAFT=1
/*
//CTL3CNTL DD *
OUTFIL IFTHEN=(WHEN=(1,3,CH,EQ,C'799'),
BUILD=(1,35,36:103,16,51:28X,79:79,15)),
IFTHEN=(WHEN=NONE,BUILD=(1,94)),
FNAMES=OUT1
/*




this is the jcl which i ran
the input file total size is 94 so i have changed it accordingly
instead of "invalid account no" we insert it whenever a 799 record is found

Can u pls help us further on this
and thanks for ur help.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Nov 21, 2008 3:24 pm    Post subject:
Reply with quote

Code:
BUILD=(1,35,36:103,16,51:28X,79:79,15)),

Check this line.
it should be
Code:
BUILD=(1,35,36:103,16,52:27X,79:79,15)),
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Fri Nov 21, 2008 3:40 pm    Post subject:
Reply with quote

still getting the same error icon_sad.gif

error code is posted below

ICE146I 0 END OF STATEMENTS FROM CTL3CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CTL3,SORTIN=T1,
TOUT=OUT1,DYNALLOC,SZERO,EQUALS,NOVLSHRT,LOCALE=NONE,
HECK
SORT FIELDS=(95,8,ZD,A)
MODS E35=(ICE35DU,12288)
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE027A 1 END OF FIELD BEYOND MAXIMUM RECORD LENGTH
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E4-K90007 E7-K24705
ICE052I 3 END OF DFSORT
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Nov 21, 2008 4:07 pm    Post subject:
Reply with quote

Post TOOLMSG MESSAGES.
Back to top
View user's profile Send private message
edwin_infy

New User


Joined: 01 Jul 2008
Posts: 32
Location: chennai

PostPosted: Fri Nov 21, 2008 4:10 pm    Post subject:
Reply with quote

0 MODE IN EFFECT: STOP

COPY FROM(INP1) TO(T1) USING(CTL1)
0 DFSORT CALL 0001 FOR COPY FROM INP1 TO T1 USING CTL1CNTL
0 OPERATION RETURN CODE: 00

COPY FROM(INP1) TO(OUT1) USING(CTL2)
0 DFSORT CALL 0002 FOR COPY FROM INP1 TO OUT1 USING CTL2CNTL
0 OPERATION RETURN CODE: 00
SPLICE FROM(T1) TO(OUT1) ON(95,8,ZD) -
WITHALL WITH(1,94) KEEPBASE USING(CTL3)
0 DFSORT CALL 0003 FOR SORT FROM T1 TO OUT1 USING CTL3CNTL
0 OPERATION RETURN CODE: 16


0 DFSORT ICETOOL UTILITY RUN ENDED - RETURN CODE: 16
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Nov 21, 2008 9:59 pm    Post subject:
Reply with quote

edwin_infy,

Sambhaji assumed your input file has RECFM=FB and LRECL=80, but didn't bother to mention that. Is that the actual RECFM and LRECL of your input file? If not, what is the RECFM and LRECL of your input file

If your input file does have RECFM=FB and LRECL=80, show the complete set of //DFSMSG messages you received.

Also, what is the length of the batch name? Does 'INVALID ACCOUNT NUMBER' always appear in '7' record? Does it always start in the same position (what position?) or can its starting position vary?
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 7:17 pm    Post subject:
Reply with quote

hi

Any idea what the error is
I cud not post the tool MSG as am not in mainframe
Will post it on Monday

Thks
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:12 pm    Post subject: Reply to: How can i retrieve the batch name for each detail
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
Frank Yaeger

DFSORT Moderator


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

PostPosted: Sat Nov 22, 2008 9:23 pm    Post subject:
Reply with quote

Quote:
LRECL is 94 and format is fb


Then Sambhaji's assumption of LRECL=80 was wrong.

Quote:
Should That be VB


No.

Please answer this question I asked in my previous post.

Quote:

Does 'INVALID ACCOUNT NUMBER' always appear in '7' record? Does it always start in the same position (what position?) or can its starting position vary?
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
This topic is locked: you cannot edit posts or make replies. MIPS reduction for Batch job Virendra Shambharkar All Other Mainframe Topics 8 Mon Nov 07, 2016 4:02 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm


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