Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort Move based upon the condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort Move based upon the condition
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: 7912
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 3:53 pm    Post subject:
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    Post subject:
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: 7912
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 4:01 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Sep 15, 2009 4:13 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Sep 15, 2009 4:32 pm    Post subject:
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    Post subject:
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    Post subject:
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: 7912
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 4:35 pm    Post subject:
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    Post subject:
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: 7912
Location: Bellevue, IA

PostPosted: Tue Sep 15, 2009 4:49 pm    Post subject:
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: 2158
Location: @my desk

PostPosted: Tue Sep 15, 2009 7:27 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us