View previous topic :: View next topic
|
Author |
Message |
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Dear friends,
I have file with 12000 record length,
I have to create a new file by applying the condition as listed below:
If Position 813 = 1
Move 1451:12000 to new file
else
Move 1251:12000 to new file |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Well, go for it. You didn't ask any questions, nor state any problems, so we'll just wish you well in your endeavor. |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Oops Sorry Robert,
I had a question and i dont know how it got truncated.
Need to know is there any simple way to achieve it. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You can do this with a program, SAS, or File Aid for sure. I believe it's possible using SORT but I'm not a SORT expert so couldn't say for sure. Without knowing the site and what tools and utilities are available, the best suggestion we can make is to contact your team leader, coworkers, or site support group for suggestions as to what is available. |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
File Aid, Sort, SAS are available |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
in what position in the new file is the string going to be placed ?
Gerry |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Hi Aravindhan,
You can use the
IF condition if the JCL
Code: |
OUTFIL FNAMES=SORTOUT
IFTHEN=(WHEN=(813,1,CH,EQ,C'1')
BUILD=(1451:12000 )
OUTFIL FNAMES=FILE2,SAVE
BUILD=(1251:12000)
|
Hope this work,
I do not have the connectivity as of now, may need to check for some syntax |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Hi Gerry,
It is in position 813. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
just so I understand you correctly, cols 1 to 812 is copied as is
new string is placed in cols 813 to col 822, and cols 814 to 12000 is copied to cols 823 to 12009.
Is this correct ?
Is the input file an FB file ?
Gerry |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Hi Ketan Varhade
The position 813 is packed decimal even |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
The input file is VB,
and if 813 packed decimal of two bytes (813 - 814) equal to 1 then i have to move it from 1451:12000 else 1251:12000
I dont worry about the bytes 1:1250 |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
A one-character packed decimal field? Extremely unusual in my experience. |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Robert, its two byte |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
New information appears!
How does the field being two bytes match up with your original statement that position 813 = 1 is your compare condition? Based on your original statement, the compare would be against hex 'F1' but now you're saying the compare is '001C'x or '001F'x (depending upon whether the packed field is signed or unsigned -- another little tidbit that would be helpful to know). |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
then i have to move it from 1451:12000 else 1251:12000 |
What does 'it' mean here? Does "1451:12000" mean from pos-1451 till pos-12000 or is it from pos-1451 select 12000 bytes? Explain clearly which pos in input file goes to which pos in output file/output files. |
|
Back to top |
|
|
|