IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort Move based upon the condition


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 15, 2009 3:39 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 15, 2009 3:53 pm
Reply with quote

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
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 15, 2009 3:56 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 15, 2009 4:01 pm
Reply with quote

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
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 15, 2009 4:08 pm
Reply with quote

File Aid, Sort, SAS are available
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Sep 15, 2009 4:13 pm
Reply with quote

Hi,

in what position in the new file is the string going to be placed ?


Gerry
Back to top
View user's profile Send private message
Ketan Varhade

Active User


Joined: 29 Jun 2009
Posts: 197
Location: Mumbai

PostPosted: Tue Sep 15, 2009 4:16 pm
Reply with quote

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
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 15, 2009 4:21 pm
Reply with quote

Hi Gerry,
It is in position 813.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Sep 15, 2009 4:32 pm
Reply with quote

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
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 15, 2009 4:33 pm
Reply with quote

Hi Ketan Varhade

The position 813 is packed decimal even
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 15, 2009 4:35 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 15, 2009 4:35 pm
Reply with quote

A one-character packed decimal field? Extremely unusual in my experience.
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Tue Sep 15, 2009 4:43 pm
Reply with quote

Robert, its two byte
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 15, 2009 4:49 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Sep 15, 2009 7:27 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
Search our Forums:

Back to Top