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
 

 

Conditional formatting using SYNCSORT

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

New User


Joined: 28 Nov 2006
Posts: 75
Location: India

PostPosted: Fri Dec 12, 2008 12:02 am    Post subject: Conditional formatting using SYNCSORT
Reply with quote

I have an employee information file which has a field to hold the location. My requirement is to update the zipcode of a only one location with a new value.

Thanks,
Balaji
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: Fri Dec 12, 2008 12:43 am    Post subject:
Reply with quote

Hello,

For anyone to help, you need to provide something to work with. . .

You need to post some input data (enough to represent whatever possibilities could occur in the real data), the output you want from that input, and the rules to get from the input to the output.

You should also mention the recfm and lrecl of the files as well as the positions in the record of the relevant fields (and the data type if it matters).
Back to top
View user's profile Send private message
nbalajibe
Warnings : 1

New User


Joined: 28 Nov 2006
Posts: 75
Location: India

PostPosted: Fri Dec 12, 2008 1:04 am    Post subject:
Reply with quote

Below is a sample file

Input file

Code:
EID       Name      State      ZIPCODE
11111   AAAAAAA      CA      91350
22222   BBBBBBB      WA      
33333   DDDDDDD      CA      91350
22222   EEEEEEE      WA      


Required output

Code:
EID       Name      State      ZIPCODE
11111   AAAAAAA      CA      91500
22222   BBBBBBB      WA      
33333   DDDDDDD      CA      91500
22222   EEEEEEE      WA      


This is a simple file with fixed block and 80 lrecl.
The State should be taken as reference. If the state is "CA" the ZIPCODE should be hardcoded to the new value. else it should be spaced out.
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: Fri Dec 12, 2008 1:22 am    Post subject:
Reply with quote

Hello,

Quote:
The State should be taken as reference
To what?
Quote:
If the state is "CA" the ZIPCODE should be hardcoded to the new value
You show a value in the output, but how would the process know which value to use? How is this new value provided to the process? What if there are 5 separate CA zipcodes in the input file? Even if the file has only 1 zipcode, what if it is not 91350?

You need to do a much more thorough job of describing the requirement.
Back to top
View user's profile Send private message
nbalajibe
Warnings : 1

New User


Joined: 28 Nov 2006
Posts: 75
Location: India

PostPosted: Fri Dec 12, 2008 1:36 am    Post subject:
Reply with quote

Hi,

I want to keep the example simple.
Lets consider that we are having only members from "CA" and "WA" in the input file. The output should have zipcode as "91350" for all "CA" members and spaces for all "WA" members.
These are the only two states and only two zipcodes.
Back to top
View user's profile Send private message
nbalajibe
Warnings : 1

New User


Joined: 28 Nov 2006
Posts: 75
Location: India

PostPosted: Fri Dec 12, 2008 1:37 am    Post subject:
Reply with quote

Sorry the output should have "91500" for all "CA" members and spaces for all "WA" members.
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: Fri Dec 12, 2008 1:49 am    Post subject:
Reply with quote

Hello,

This isn't tested, but should be close. . . .
Code:
//SYSIN    DD *                                     
 SORT FIELDS=COPY                                   
 INREC IFTHEN=(WHEN=(nn,2,CH,EQ,C'CA'),OVERLAY=(nn:C'91500'),HIT=NEXT), 
       IFTHEN=(WHEN=(nn,2,CH,EQ,C'WA'),OVERLAY=(nn:C'     '),HIT=NEXT) 


You'll need to fill in the nn's as you didn't post the positions in the data.
Back to top
View user's profile Send private message
nbalajibe
Warnings : 1

New User


Joined: 28 Nov 2006
Posts: 75
Location: India

PostPosted: Fri Dec 12, 2008 3:06 am    Post subject:
Reply with quote

Thanks a lot Dick.
It works.
I tried searching in net for the information regarding this sort card but could not get it. Could you please let me a know a good reference for explanation on this sort card?
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: Fri Dec 12, 2008 6:06 am    Post subject: Reply to: Conditional formatting using SYNCSORT
Reply with quote

You're welcome - good to hear it works icon_smile.gif

The best reference is the Syncsort documentation which you can get for free from Syncsort if your organization is licensed.

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

Moderator


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

PostPosted: Fri Dec 12, 2008 6:18 am    Post subject:
Reply with quote

nbalajibe,

Adding to what Dick suggested, you might not need the 'HIT=NEXT' if the conditions are mutually exclusive.
Back to top
View user's profile Send private message
nbalajibe
Warnings : 1

New User


Joined: 28 Nov 2006
Posts: 75
Location: India

PostPosted: Fri Dec 12, 2008 8:30 am    Post subject:
Reply with quote

Hi Arun,

Thanks for the sugestion.
Could you please let me know some materials for getting information on each of these key words?
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Dec 12, 2008 8:48 am    Post subject:
Reply with quote

Quote:
The best reference is the Syncsort documentation which you can get for free from Syncsort if your organization is licensed.
nbalajibe,

What you need to do has already been suggested here. As you are licensed to use Syncsort, you can Contact SyncSort support or send a PM to Alissa to get a manual. They'll be happy to assist you.
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 Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
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


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