View previous topic :: View next topic
Author
Message
Vsonawane New User Joined: 12 May 2008Posts: 13 Location: Hartford
Hi,
I have a input file having records in below format.
350 011458 9856124 NOT PCCL POLICY
350 012472 7921002 UNSUCCESSFUL MOVE TO ACCT
375 013479 7864321 INVALID PIN
375 014987 8521471 INVALID PIN
The first 3 bytes are transaction type.
Using Sort I want to create a New file
if 350 then
D90011458 90 is to be inserted
D90012472 90 is to be inserted
If 375 then
D967864321 96 is to be inserted
D968527471 96 is to be inserted
So the file will have 4 records.
D90011458
D90012472
D967864321
D968527471
I can do the above by using 2 step sort. one sort for 350 and other sort for 375. using INCLUDE.
but not able to do it in one sort.
Can the above thing be done in one sort parm?
Can any body help ?
Thanks,
Vikas
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
You can use a DFSORT job like the following to do what you asked for:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
350 011458 9856124 NOT PCCL POLICY
350 012472 7921002 UNSUCCESSFUL MOVE TO ACCT
375 013479 7864321 INVALID PIN
375 014987 8521471 INVALID PIN
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,3,SS,EQ,C'350,375')
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'350'),
BUILD=(C'D90',5,6)),
IFTHEN=(WHEN=(1,3,CH,EQ,C'375'),
BUILD=(C'D96',12,6))
/*
Back to top
Vsonawane New User Joined: 12 May 2008Posts: 13 Location: Hartford
Thanks Frank! You are the best.
One more thing my input file is VB and i want the output file as FB.. i tried giving CONVERT in the SYSIN but not successful. Could you please suggest?
Thanks
Vikas
Back to top
Vsonawane New User Joined: 12 May 2008Posts: 13 Location: Hartford
Hi Frank, Here is the actual sort which i am using.
Is there any way if i can build the outrec of FB?
SORT FIELDS=COPY
INCLUDE COND=(69,3,SS,EQ,C'350,351,370,470,352,357,368')
INREC IFTHEN=(WHEN=(69,3,CH,EQ,C'350',OR,
69,3,CH,EQ,C'351',OR,
69,3,CH,EQ,C'370',OR,
69,3,CH,EQ,C'470'),
BUILD=(1,4,C'D',
6X,
14X,
C'90',
230,17,
17X,
20X)),
IFTHEN=(WHEN=(69,3,CH,EQ,C'352',OR,
69,3,CH,EQ,C'357',OR,
69,3,CH,EQ,C'368'),
BUILD=(1,4,C'D',
6X,
14X,
C'96',
291,17,
17X,
20X))
Thanks,
Vikas
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Since your input is VB, I assume you're counting the RDW when you figure out the starting positions - right?
To convert from VB to FB, use an OUTFIL statement like this:
Code:
OUTFIL VTOF,BUILD=(5,n)
where n is the length you want for the FB output records. From your example, it looks like n would be 77.
Quote:
i tried giving CONVERT in the SYSIN but not successful
This kind of statement is not helpful unless you show the control statements you tried to use to do the convert and the error messages you received.
Back to top
Please enable JavaScript!