Page 1 of 1

Issue unpacking fields

PostPosted: Sat Apr 11, 2020 2:05 am
by bendiesel
Hi All-

I am trying to copy an existing dataset and unpack any packed fields. I ran into an issue where some of fields that where defined as packed were simply left as BLANKs, so I would like to print them out as BLANK vs the packed interpretation. When I tried the attached code (which is a simplified representation of what Im working with), it evaluates the first clause, but it does appear to evaluate the second clause where the overlay happens. Any suggestions?

I've toyed around with the selection logic, even duplicating the top clause into the bottom clause, but Im not able to get both clauses to evaluate - just the top.

Be kind here.. Im very inexperienced with SORT :)

Thanks in advance,
Ben



//SYSIN    DD *                        
  OPTION COPY                          
  INREC IFTHEN=(WHEN=(12,1,CH,EQ,C'A'),
               BUILD=(1,3,            
                     4,1,              
                     5,7,              
                     12,1,          
                     13,3,            
                     16,2,PD,M11),HIT=NEXT),        
         IFTHEN=(WHEN=(12,1,CH,EQ,C'A',AND,16,2,PD,NE,NUM),
                OVERLAY=(16:C'   '),                                  
 

Re: Newbie Sort Question..

PostPosted: Sun Apr 12, 2020 12:05 am
by sergeyken
You try to unpack your PD field in your first IFTHEN - before it is verified against correct NUM format in your second IFTHEN.

The problem is not in your SORT experience; the problem is in your (mis)understanding of the program logic, whatever language/utility/tool you try to use.