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

Fixed output from delimited input, fields may not exist


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Thu Mar 17, 2011 2:53 am
Reply with quote

Hi,
I have this file structure:
Code:

Data Set Name . . . . : TS2.MA.SAP.LOAD03                               
                                                                       
General Data                           Current Allocation               
 Management class . . : TESTDSET        Allocated cylinders : 58       
 Storage class  . . . : TESTDSET        Allocated extents . : 29       
  Volume serial . . . : TEST17 +                                       
  Device type . . . . : 3390                                           
 Data class . . . . . : MULTIVE                                         
  Organization  . . . : PS             Current Utilization             
  Record format . . . : FB              Used cylinders  . . : 58       
  Record length . . . : 1233            Used extents  . . . : 29       
  Block size  . . . . : 27126                                           
  1st extent cylinders: 2                                               
  Secondary cylinders : 2              Dates                           
  Data set name type  : EXTENDED        Creation date . . . : 2011/03/16
  SMS Compressible. . : NO              Referenced date . . : 2011/03/16
                                        Expiration date . . : ***None***

The records inside this file look like this:
Code:

0526720   .N001..ZH01.BODE CALL & STROUPE LLP..ATTORNEYS AT LAW.P0526720..27628-
0535230   .N001..ZH01.EVIDENTIA ENGINEERING INC...P0535230.10 PARK PL.07078-2826
0546240   .N001.MTLM.ZH01.URBAN ENGINEERS INC...P0546240.530 WALNUT ST FL 14.191
0553940   .N001..ZH01.APL LOGISTICS TRANSPORT MGT SVC INC...P0553940.34119 W 12
0564310   .N001..ZH01.DENNIS WILLIAMS...P0564310.815 CEDAR FALLS DR.40047-7827.M
0582490   .N001..ZH01.WILLIAM AND MARY SCHOOL OF LAW...P0582490..23187-8795.WILL
0589540   .N001..ZH01.GIBSON DUNN & CRUTCHER LLP...P0589540.DEPARTMENT 0723T.900
0619380   .N001..ZH01.ROBERT L ALLGOOD PC...P0619380.1450 GREENE ST STE 105.3090
0627980   .N001..ZH01.MARS PETCARE US INC..ATTN CHAD HELBERG.P0627980..37068-300
0653380   .N001..ZH01.DETECTIVES PRIVATE INVEST INC..DBA PRIME SOURCE INVESTIGAT
0656760   .N001..ZH01.ALABAMA & GULF COAST RAILWAY CORP...P0656760.734 HIXON RD.
0682330   .N001..ZH01.SEVERSTAL WHEELING INC..DBA WHEELING CORRUGATING COMPANY.P
0697695   .N001..ZH01.MANKO GOLD & KATCHER...P0697695.401 E CITY AVE STE 500.190
0698356   .N001..ZH01.CENTER FOR FORENSIC ECONOMIC STUDIE.S..P0698356.1608 WALNU
0726030   .N001..ZH01.GLOBALOPTIONS SERVICES INC..ATTN DEPT 2546.P0726030..75312
0747890   .N001..ZH01.U S COAST GUARD CIVIL PENALTIES...P0747890..28272-0945.CHA

With Hex ON the delimiter in the file is the x'05':
Code:

0526720   .N001..ZH01.BODE CALL & STROUPE LLP..ATTORNEYS AT LAW.P0526720..27628-
FFFFFFF4440DFFF00ECFF0CDCC4CCDD454EEDDEDC4DDD00CEEDDDCEE4CE4DCE0DFFFFFFF00FFFFF6
05267200005500155980152645031330002396475033755133695582013031657052672055276280
 ------------------------------------------------------------------------------
0535230   .N001..ZH01.EVIDENTIA ENGINEERING INC...P0535230.10 PARK PL.07078-2826
FFFFFFF4440DFFF00ECFF0CECCCDECC4CDCCDCCDCDC4CDC000DFFFFFFF0FF4DCDD4DD0FFFFF6FFFF
05352300005500155980155594553910557955599570953555705352305100719207350707802826
 ------------------------------------------------------------------------------
0546240   .N001.MTLM.ZH01.URBAN ENGINEERS INC...P0546240.530 WALNUT ST FL 14.191
FFFFFFF4440DFFF0DEDD0ECFF0EDCCD4CDCCDCCDE4CDC000DFFFFFFF0FFF4ECDDEE4EE4CD4FF0FFF
05462400005500154334598015492150557955592095355570546240553006135430230630145191
 ------------------------------------------------------------------------------
0553940   .N001..ZH01.APL LOGISTICS TRANSPORT MGT SVC INC...P0553940.34119 W 12
FFFFFFF4440DFFF00ECFF0CDD4DDCCEECCE4EDCDEDDDE4DCE4EEC4CDC000DFFFFFFF0FFFFF4E4FF4


Where there are multiple x'05' delimiters side by side that means the input record is void of this next field being populated. So 3 X'05' in a row mean that 2 fields are not populated because the x'05' delimites the previous field.

The question is maybe PARSE and the ENDBEFR= give me the leverage to apply spaces to the output record like there was data there on the input ? Or some combination thereof.

My output record should look like:

Code:

05 LIFNR       PIC X(10).
05 BURKS       PIC X(04).
05 EKORG       PIC X(04).
05 KTOKK       PIC X(04).
05 NAME1       PIC X(35).
05 NAME2       PIC X(35).
05 NAME3       PIC X(35).
05 SORT1       PIC X(20).
05 STREET      PIC X(70).
05 POSTCODE1   PIC X(10).
05 CITY1       PIC X(40).
05 COUNTRY     PIC X(02).
05 REGION      PIC X(03).
05 POBOX       PIC X(10).
05 TELENUM     PIC X(30).
05 TELEXT      PIC X(10).
05 MOBPHN      PIC X(30).
05 FAXNUM      PIC X(30).
05 SMPTADD     PIC X(241).
05 REMARK      PIC X(50).
05 BEGRU       PIC X(04).
05 VBUND       PIC X(06).
05 KONZS       PIC X(10).
05 STCD1       PIC X(16).
05 STCD2       PIC X(11).
05 TXJCD       PIC X(15).
05 BAHNS       PIC X(25).
05 SCACD       PIC X(04).
05 QSSYS       PIC X(04).
05 BANKS       PIC X(03).
05 BANKL       PIC X(15).
05 BANKN       PIC X(18).
05 BKONT       PIC X(02).
05 KOINH       PIC X(60).
05 IBAN        PIC X(34).
05 IBAN1       PIC X(34).
05 BVTYP       PIC X(34).
05 BKREF       PIC X(04).
05 ZEZER       PIC X(01).
05 BANKA       PIC X(60).
05 PAFKT       PIC X(02).
05 AKONT       PIC X(10).
05 ZUAWA       PIC X(03).
05 MINDK       PIC X(03).
05 QSSKZ       PIC X(02).
05 QSREC       PIC X(02).
05 ZTERM       PIC X(04).
05 GUZTE       PIC X(04).
05 REPRF       PIC X(01).
05 ZWELS       PIC X(10).
05 ZAHLS       PIC X(01).
05 ALTKN       PIC X(10).
05 PERNR       PIC X(08).
05 LNRZB       PIC X(10).
05 XPORE       PIC X(01).
05 UZAWE       PIC X(03).
05 WAERS       PIC X(05).
05 ZTERM1      PIC X(04).
05 INCO1       PIC X(03).
05 INCO2       PIC X(28).
05 WEBRE       PIC X(01).
05 KZABS       PIC X(01).
05 KZAUT       PIC X(01).
05 XERSY       PIC X(01).
05 PARVW       PIC X(02).
05 GPARN       PIC X(10).
05 DEFPA       PIC X(01).
05 ZZAPGSID1   PIC X(20).
05 ZZMMGSID    PIC X(20).
05 ZZWTTD      PIC X(10).
05 PAYORDAT    PIC X(01).
05 STCD3       PIC X(18).


That is the next goofy thing I gotta do. I am running some tests after this to see if i can come up with an answer.
Again, thanks.
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: Thu Mar 17, 2011 4:53 am
Reply with quote

Quote:
The question is maybe PARSE and the ENDBEFR= give me the leverage to apply spaces to the output record like there was data there on the input ? Or some combination thereof.


Yes. If you use %nn=(ENDBEFR=X'05',FIXLEN=n) and there are two contiguous X'05's, %nn will be set to n blanks which will appear in the output record if you use %nn in BUILD.

Is that what you wanted to know?
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Thu Mar 17, 2011 6:57 pm
Reply with quote

Yes Frank, it is. I was not sure if it defaulted or the command would literally pull from the record the number of bytes i used in FIXLEN.
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Thu Mar 17, 2011 11:19 pm
Reply with quote

Worked like a champ. This help will fix a lot of things we are going to need to do. The team thanks you all and by the way I got 5 'This ___ is fantastic!'.
Many thanks.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top