TechTalk: Creating A Logical File Over a Packed M

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

If you are stuck with a packed MMDDYY date field, and need to create a logical access path by date over the file, you can break it down using the sub-string feature in DDS (see Figures 1 and 2). To do this you must first override its definition to zoned, because technically you cannot sub-string a packed numeric field. The SST keyword uses three parameters: the field name, the starting position, and the result length. The result must be defined as input only and is always character. Note also that because a record format containing an input only field cannot be shared with the physical file, you must list all of the other fields from the physical if you wish to use them.

Kathleen Kostuck Milwaukee, Wisconsin


TechTalk: Creating A Logical File Over a Packed M

Figure 1 Physical file definition

 Figure 1: Physical File Definition ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7 A R RECORD A FLD1 3 0 COLHDG('FIELD #1') A FLD2 1 COLHDG('FIELD #2') A MMDDYY 6 0 COLHDG('DATE' 'FIELD') A K FLD1 ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7 
TechTalk: Creating A Logical File Over a Packed M

Figure 2 Logical file by YYMMDD date

 Figure 2: Logical by YYMMDD Date ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7 A R RECORD PFILE(FILENAME) A FLD1 A FLD2 A MMDDYY S A FLDYY I SST(MMDDYY 5 2) A FLDMM I SST(MMDDYY 1 2) A FLDDD I SST(MMDDYY 3 2) A K FLDYY A K FLDMM A K FLDDD ....1.... ....2.... ....3.... ....4.... ....5.... ....6.... ....7 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$