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

Conditional Data Conversion in SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Fri Feb 08, 2008 9:50 pm
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
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 Developer


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

PostPosted: Sun Feb 17, 2008 10:07 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top