View previous topic :: View next topic
|
Author |
Message |
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
I have a file in packed decimal format (comp3)
My condition is to check the input file for a
accttype =200 and sub account = 20
if i find one , the out file should have the new acc number 300 instead of 200.
File length si 18 bytes.
how do accomplish this? |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Nirmal,
Would you please provide sample i/p & o/p as well as fields definations? |
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
i/p
00120020 11111111111111111111111
00220120 11111111111111111111111
00320018 11111111111111111111111
o/p
00130020 11111111111111111111111 |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Nirmal,
You can use below sort card to acheive this.
Code: |
OPTION COPY
INCLUDE COND=(4,5,CH,EQ,C'20020')
OUTREC FIELDS=(1,3,C'300',7:7,73) |
|
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
hey thanks that was fine
but i mentioned the mas packed decimal. for your understanding i gave sample i ncharacter form |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
but i mentioned the mas packed decimal. for your understanding i gave sample i ncharacter form
|
so what?
so all you have to do is change guptae's include parm to look for your packed-decimal. the sort manuals go into painful detail about this and what the syntax is.
so, now for you homework assignment, RTFM! |
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
Well Mister
Itried that tooo..... Either i get syntax error or data illegal error.....
i believ its not the correct syntax |
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
..ð&%...@.&....îØ.
..ð.<...@.&....îØ.
..ð&%.ð.@.&....c-.
..ðØ....@.&....c-.
is the data format inside file 1 |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Nirmal,
Would you please provide field defination & starting positions? |
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
01 TESTFILE.
05 TEST-IN PIC S9(5) COMP-3.
05 TEST-ACCT-NO.
10 TEST-ACC PIC S9(3) COMP-3.
10 TEST-SACC PIC S9(3) COMP-3.
05 POST-CD PIC S9(3) COMP-3.
05 TRANS-DT PIC S9(5) COMP-3.
05 AMT PIC S9(9)V9(2) COMP-3.
Thats the copy book and the data looks like
..ð&%...@.&....îØ.
..ð.<...@.&....îØ.
..ð&%.ð.@.&....c-.
..ðØ....@.&....c-.
I need to chec kfor TEST-ACC = 200 & TEST-SACC = 20.. if both matches i need to write the data into a different file with TEST-ACC as 300
thanks in advance Guptae |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
nirmal.poikaikumaran wrote: |
Itried that tooo..... Either i get syntax error or data illegal error.....
i believ its not the correct syntax |
Quit making us guess and post your jcl and all your sysouts.
nirmal.poikaikumaran wrote: |
Code: |
01 TESTFILE.
05 TEST-IN PIC S9(5) COMP-3.
05 TEST-ACCT-NO.
10 TEST-ACC PIC S9(3) COMP-3.
10 TEST-SACC PIC S9(3) COMP-3.
05 POST-CD PIC S9(3) COMP-3.
05 TRANS-DT PIC S9(5) COMP-3.
05 AMT PIC S9(9)V9(2) COMP-3. |
|
nirmal.poikaikumaran wrote: |
..ð&%...@.&....îØ.
..ð.<...@.&....îØ.
..ð&%.ð.@.&....c-.
..ðØ....@.&....c-. |
Since you can display the data, try it with hex on and repost it..... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Nirmal,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(4,2,PD,EQ,+200,AND,6,2,PD,EQ,+20)
OUTREC OVERLAY=(4:+300,TO=PD,LENGTH=2)
/*
|
|
|
Back to top |
|
|
|