View previous topic :: View next topic
|
Author |
Message |
entebbe2094
New User
Joined: 02 Dec 2008 Posts: 2 Location: Bangalore
|
|
|
|
Please help
here is the input record:
Code: |
---7----+----8----+----9----+----0----
1 2097187 16371 SUM_C001
1 2099404 16369 SUWM0002
1 2099424 16331 SUPBSMIS
1 2099426 16341 MAYFIEJA
500 -2147483648 16376 TDPUSER
500 -2147483648 16377 TDPUSER
|
I need to align 16371,16369,16331,16341 with 16376 and 16377 so they start from same pos 87. (shift by 4 spaces)
Also I need to align all the names starting at pos 89 with TDPUSER so that they start from same pos 95(shift by 4 spaces)
None of the records should be dropped. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You didn't do a very good job of explaining the "rules". But assuming you want to shift fields in the records that have a '1' in position 69, you can use a DFSORT job like this:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(69,1,CH,EQ,C'1'),
BUILD=(1,80,87:81,5,95:89,8))
/*
|
If that's not what you want to do, then you need to explain more clearly what is is exactly that you want to do. |
|
Back to top |
|
|
entebbe2094
New User
Joined: 02 Dec 2008 Posts: 2 Location: Bangalore
|
|
|
|
I apologize if my explanation wasnt good enough .. Ill just try out the code that you have suggested and will let you know ... Thanks so much for your reply ... |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
ent,
Do as Frank suggested and it would work.
Btw
Quote: |
I need to align 16371,16369,16331,16341 with 16376 and 16377 so they start from same pos 87. (shift by 4 spaces)
Also I need to align all the names starting at pos 89 with TDPUSER so that they start from same pos 95(shift by 4 spaces) |
You will have to shift by 6 bytes and not 4 as mentioned in your first post. |
|
Back to top |
|
|
|