Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SYNCSORT - File Formatting Help

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
meteorite

New User


Joined: 31 May 2006
Posts: 2

PostPosted: Mon Jun 16, 2008 1:21 pm    Post subject: SYNCSORT - File Formatting Help
Reply with quote

Hi,

I have the following Input File:

Field1 Field2 Field3
AAAA bbbbb 11111
BBBB 33333
DDDD 33235
CCCC bbbbb 23433

<Note: "bbbbb" stands for blanks/spaces.>

I need to reformat it as shown below:

Field1 Field2
AAAA +11111
BBBB -33333
DDDD -33235
CCCC +23433

i.e., the difference in the output is that the values in Field3 of Input File should be preceded with a + sign and those in Field2 should be preceded with a - sign and all of these values should appear in Field2's position in the output file. And, do note that the input file has no fixed pattern in the order of records, i.e., each record can have a value in either the Field2 or the Field3, but only in one of them.

Do let me know if the above can be solved using SYNCSORT?
Back to top
View user's profile Send private message

Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Mon Jun 16, 2008 4:06 pm    Post subject:
Reply with quote

This should work. Please try and confirm.

Code:

 OPTION COPY                                 
 INREC IFTHEN=(WHEN=(6,5,CH,LT,12,5,CH),     
        BUILD=(1,5,C'+',12,5)),               
        IFTHEN=(WHEN=(6,5,CH,GT,12,5,CH),     
        BUILD=(1,5,C'-',6,5))                 
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 16, 2008 8:19 pm    Post subject:
Reply with quote

Hello,

Quote:
This should work. Please try and confirm.
Did you try the code?

The code compares 2 fields in a record and generates a +/- based on the output of the compare. I see nothing like that in the initial request. . .
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Mon Jun 16, 2008 9:01 pm    Post subject:
Reply with quote

Hi Dick,

I should have mentioned this earlier. Sorry.

I assumed that for records where field2 and field3 are present field2 is always alphabetic and field3 is numeric. Similarly for the other record assumed field2 is numeric and field3 is alphabetic/spaces. I have tested with the given data and it works.

For ex. for the first record AAAA bbbbb 11111

BBBBB is less than 111111 hence AAAA +11111 is written to the output

For second record BBBB 33333

333333 is greater than spaces hence BBBB -333333 is written to the output.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 16, 2008 10:12 pm    Post subject: Reply to: SYNCSORT - File Formatting Help
Reply with quote

Hello Manu,

Thanks for the clarification.

My simple brain was thinking of just checking for non-blank icon_smile.gif

d
Back to top
View user's profile Send private message
meteorite

New User


Joined: 31 May 2006
Posts: 2

PostPosted: Tue Jun 17, 2008 2:00 am    Post subject:
Reply with quote

Manu,

Thanks a lot! Your solution worked like a charm icon_biggrin.gif

Regards,
m
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
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us