|
|
| Author |
Message |
cmohanraj
New User
Joined: 04 Apr 2005 Posts: 15
|
|
|
|
there are 3 customers of a bank.
A,B,C
I want to write the transactions done by each of them in separate files
Let the account numbers be 1,2,3
Now tell me the steps how u will logically work out this.
(like how u will proceed doing this let it be jcl,cobol ) |
|
| Back to top |
|
 |
References
|
Posted: Mon Apr 11, 2005 2:46 pm Post subject: Re: 3 diff transactions 3 accounts |
 |
|
|
 |
Vayunandanrao
New User
Joined: 22 Mar 2005 Posts: 9
|
|
|
|
Hi ,
First accept the a/c number based on a/c number , move or go to perticular statement/paragraph . There u can do as ur wish.
I think this is correct , if any mistake plz let me back
Regards
-VayunandanRao- |
|
| Back to top |
|
 |
sribks2005
New User
Joined: 04 Apr 2005 Posts: 20 Location: Mysore
|
|
|
|
hi,
we can use "SORT" utility in JCL for this purpose.
Below i have given JCL code snippet to illustrate on this.
This will create 3 files based on the first 2 numbers in the input file.
Records having first 2 digits "01" will be put in file 1[ SORTOF1]
Records having first 2 digits "02" will be put in file 2 [SORTOF2]
Records having first 2 digits "03" will be put in file 2 [SORTOF3]
===========================================
Add job card info here
//PS01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN="input file name here",DISP=SHR
//*
//SORTOF1 DD DSN=B052DNS.BKS4.RECORD1,
// DISP=(,CATLG,DELETE),
// UNIT=TEST,SPACE=(TRK,(10,50),RLSE),
// DCB=(B0.DSCB,RECFM=FB,LRECL=80,BLKSIZE=0)
//SORTOF2 DD DSN=B052DNS.BKS4.RECORD2,
// DISP=(,CATLG,DELETE),
// UNIT=TEST,SPACE=(TRK,(10,50),RLSE),
// DCB=(B0.DSCB,RECFM=FB,LRECL=80,BLKSIZE=0)
//SORTOF3 DD DSN=B052DNS.BKS4.RECORD3,
// DISP=(,CATLG,DELETE),
// UNIT=TEST,SPACE=(TRK,(10,50),RLSE),
// DCB=(B0.DSCB,RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=1,INCLUDE=(1,2,ZD,EQ,01)
OUTFIL FILES=2,INCLUDE=(1,2,ZD,EQ,02)
OUTFIL FILES=3,INCLUDE=(1,2,ZD,EQ,03)
//*
==============================================
i hope this will help you.
please inform us , whether this is what you wanted.
Thank you |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4236 Location: San Jose, CA
|
|
|
|
Mohanraj,
Here's a DFSORT job to do what you want, assuming the account numbers are 5-byte ZD values in positions 11-15:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//OUT1 DD DSN=... output file for '1' transactions
//OUT2 DD DSN=... output file for '2' transactions
//OUT3 DD DSN=... output file for '3' transactions
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(11,5,ZD,EQ,+1)
OUTFIL FNAMES=OUT2,INCLUDE=(11,5,ZD,EQ,+2)
OUTFIL FNAMES=OUT3,INCLUDE=(11,5,ZD,EQ,+3)
/*
|
|
|
| Back to top |
|
 |
|
|
|