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.
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...
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
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.
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
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.
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.
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
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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?
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:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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).