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 Data Conversion in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Fri Feb 08, 2008 5:01 pm    Post subject: Conditional Data Conversion in SORT
Reply with quote

I do have a PS file RECFM=FB.
In that file, some fields are defined as packed decimal whereas some are binary and rest are character.
Now I want to convert PD and binary fields into displayble format. But the problem is for some records and for some fields (PD or binary) value could be "-----", indicating no data available for this field. So I don't want to convert that instance. Dashes("---") should remian dashes in output.
Input:
Code:

@..%aaaa@#$.
&@..bbbb----
----cccc@#$.
----dddd----


Output:
Code:

0001234aaaa999999
0005678bbbb---- 
----   cccc999999
----   dddd---- 


While converting to display length of field gets increased, so have to take care of that as well.
Hope I'm clear with requirement.

--Parag
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 08, 2008 9:50 pm    Post subject:
Reply with quote

It's not clear exactly what the layout of your input record is, but you can use DFSORT's IFTHEN clauses to treat fields with dashes different than fields without dashes, e.g.

Code:

   INREC IFTHEN=(WHEN=(p1,m1,CH,EQ,C'-----'),BUILD=(...),HIT=NEXT),
      IFTHEN=(WHEN=(p1,m1,CH,NE,C'----'),BUILD=(...),HIT=NEXT),
      IFTHEN=(WHEN=(p2,m2,CH,EQ,C'-----'),BUILD=(...),HIT=NEXT),
      IFTHEN=(WHEN=(p2,m2,CH,NE,C'----'),BUILD=(...),HIT=NEXT),
      ...
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Sun Feb 17, 2008 12:52 pm    Post subject:
Reply with quote

Hi Frank,
I tried your solution and it works for input file having fixed LRECL.
But the Input file I'm having has diff layout each time. In other words, its different input file with RECFM=FB and diff LRECL everytime. So I'm using SYMNAMES and generating sort cards dynamically (in previous step) to perform required functions.

Now, its tough to generate all those BUILD statements dynamically.

Isn't there any other way??
Something like converting dashes to such a value (low or high) which will not be converted by convert functions. And after converting other fields with simple OUTREC statement, converting those low or high values back to dashes.

--Parag
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun Feb 17, 2008 10:07 pm    Post subject:
Reply with quote

Quote:
Something like converting dashes to such a value (low or high) which will not be converted by convert functions. And after converting other fields with simple OUTREC statement, converting those low or high values back to dashes


I have no idea what you're talking about here. You haven't explained clearly what you're trying to do or what your input and output looks like. You talk about generating statements, but don't give any details. I'm not a mindreader. If you want my help, you're going to have to explain clearly what you want to do with good examples.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm


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