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

Need to use variable-length input field in BUILD


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

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Tue Oct 14, 2014 7:15 pm
Reply with quote

Hi,
I'm formating an SMF input file.
Somewhere in the input file ther is a variable length field which is a dataset name.
I know how to find where the dataset name is starting, I know where to find the dataset name length, but I don't see how to use the dataset name length in the outrec statement (which can be different on each record).
Here is a snippet of my code, it seems to work, but the datset name output len is always the same (because of the symbols generation step...)

Any idea ?

Code:

//*--------------------------------------------------
//SORT1    EXEC PGM=ICEMAN,REGION=6M                 
//SYSPRINT DD SYSOUT=*                               
//SYSOUT   DD SYSOUT=*                               
//SORTOUT  DD DISP=(,PASS),DSN=&&PURGE,UNIT=SYSALLDA
//SORTIN   DD  DISP=SHR,DSN=UDMZ.A500.INTGIE.SMF119 
//SYSIN    DD *                                     
 SORT FIELDS=COPY                                   
 OPTION VLSHRT                                       
  INCLUDE COND=(6,1,BI,EQ,119,AND,23,2,BI,EQ,X'0003')
//DRPT1    EXEC  PGM=ICEMAN                         
//SYSOUT   DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SYMPRINT DD SYSOUT=*                               
//STEPSOUT DD SYSOUT=*                               
//SORTIN   DD DISP=(OLD,PASS),DSN=&&PURGE           
//SYMBLS   DD DISP=(,PASS),DSN=&&SYMBOLS,           
//         UNIT=TRI                                 
//SYSIN   DD    *                                   
 OPTION COPY,DYNALLOC,VLSHRT,STOPAFT=1               
 OUTFIL FNAMES=(SYMBLS,SYMPRINT),CONVERT,           
  OUTREC=(1:C'* *** START OF SYMBOL GENERATION *** ',/,         
          1:C'SMFTNTFI,',(45,4,FI,ADD,+001),EDIT=(TTTT),/,     
          1:C'SMFTLTFI,',(49,2,FI),EDIT=(TTTT),/,               
          1:C'* **** END OF SYMBOL GENERATION **** ',80:X)     
 /*                                                             
 //SORT1    EXEC PGM=ICEMAN,REGION=6M                           
 //SYSPRINT DD SYSOUT=*                                         
 //SYSOUT   DD SYSOUT=*                                         
 //SMF30REP DD SYSOUT=*                                         
 //SORTIN   DD  DISP=(OLD,PASS),DSN=&&PURGE                     
 //SYMNAMES DD DSN=&&SYMBOLS,DISP=SHR                           
 /*                                                             
 //SYSIN    DD *                                               
  SORT FIELDS=(11,4,PD,A,7,4,FI,A)                             
  OPTION VLSHRT                                                 
  OUTFIL FNAMES=SMF30REP,CONVERT,                               
  OUTREC=(1:11,4,DT1,EDIT=(TTTT/TT/TT),X,7,4,TM2,EDIT=(TT:TT),X,
       SMFTNTFI,SMFTLTFI,                                       
       X)                                                       
/*

The ouput is :
Code:

2014/10/14 13:40 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:40 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:41 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:41 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:44 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:44 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:45 UDMZ.A500.DATATEST.MEGA10
]
But should be :
Code:

2014/10/14 13:40 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:40 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:41 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:41 UDMZ.A500.DATATEST.MEGA10
2014/10/14 13:44 UDMZ.A500.DATATEST.MEGA100
2014/10/14 13:44 UDMZ.A500.DATATEST.MEGA100
2014/10/14 13:45 UDMZ.A500.DATATEST.MEGA100
[/code]
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Oct 14, 2014 8:06 pm
Reply with quote

What value immediately follows the DSN? Humour me.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Oct 14, 2014 8:45 pm
Reply with quote

For your information, you are using the OUTREC parameter of OUTFIL, not the OUTREC statement. It would be less confusing if you used BUILD on OUTFIL instead of OUTREC on OUTFIL. And BUILD on the OUTREC statement, and on INREC. See here.
Back to top
View user's profile Send private message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Tue Oct 14, 2014 9:39 pm
Reply with quote

Thank you for your post.
So you mean :

Code:

//SYSIN    DD *                                             
 SORT FIELDS=(11,4,PD,A,7,4,FI,A)                           
 OPTION VLSHRT                                             
 OUTFIL FNAMES=SMF30REP,CONVERT,                           
 BUILD=(11,4,DT1,EDIT=(TTTT/TT/TT),X,7,4,TM2,EDIT=(TT:TT),X,
      SMFTNTFI,SMFTLTFI,                                   
      X)                                                   
/*                                                         


My problem is that symbol SMFTLTFI has a value obtained in symbol generation in the first step, but this value can change on every input record; this value is at position 49 ans is two binary digits, I tried to parse with INREC but unsuccessfully...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Oct 14, 2014 10:00 pm
Reply with quote

Yes, that is what I mean. I'll change the title of the topic to reduce confusion.

I'm trying to think of a way of avoiding 40+ IFTHEN=(WHEN=(logical-expression statements, which I assume you'd like to avoid if possible.

So what I want to know is what data immediately follows the DSN on the record. You're not interested in the rest of the record, so we are free to destroy it, if in doing that it assists your task.

For instance, if the DSN is always followed by X'00' (or some other constant value) you could FINDREP that to a bunch of space (like 44 of them) and then just use the full-length DSN from the start point that you already know.

Broadly, if the byte following the end of the DSN in the record is not valid for appearing in a DSN, then FINDREP will give you a solution. So... what follows the last character of the DSN? I assume you have the manual-page well-thumbed by now, so I'm not going to look myself :-)
Back to top
View user's profile Send private message
manuwankenobi

New User


Joined: 02 Mar 2006
Posts: 32
Location: FRANCE

PostPosted: Wed Oct 15, 2014 10:10 pm
Reply with quote

Bill Woodger wrote:
Yes, that is what I mean. I'll change the title of the topic to reduce confusion.

No problem, that's right

I'm trying to think of a way of avoiding 40+ IFTHEN=(WHEN=(logical-expression statements, which I assume you'd like to avoid if possible.

Oh yes

So what I want to know is what data immediately follows the DSN on the record. You're not interested in the rest of the record, so we are free to destroy it, if in doing that it assists your task.

I don't know this, I'm interested in the rest of the record...

For instance, if the DSN is always followed by X'00' (or some other constant value) you could FINDREP that to a bunch of space (like 44 of them) and then just use the full-length DSN from the start point that you already know.

I do not have a delimiter

Broadly, if the byte following the end of the DSN in the record is not valid for appearing in a DSN, then FINDREP will give you a solution. So... what follows the last character of the DSN? I assume you have the manual-page well-thumbed by now, so I'm not going to look myself :-)

Of course I have the manuals, but I didn't find the trick, this is why I went there...I'll do it with REXX...



Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Oct 15, 2014 11:10 pm
Reply with quote

I should have been clearer, I meant the manual for the particular SMF record.

I meant something like this:

Code:
 INREC IFTHEN=(WHEN=INIT,FINDREP=(IN=(X'00',
        X'01',X'02',X'03',X'04',X'05',X'06',X'07',X'08',X'09',
  X'0A',X'0B',X'0C',X'0D',X'0E',X'0F',X'10',X'11',X'12',X'13',
  X'14',X'15',X'16',X'17',X'18',X'19',X'1A',X'1B',X'1C',X'1D',
  X'1E',X'1F',X'20',X'21',X'22',X'23',X'24',X'25',X'26',X'27',
  X'28',X'29',X'2A',X'2B',X'2C',X'2D',X'2E',X'2F',X'30',X'31',
  X'32',X'33',X'34',X'35',X'36',X'37',X'38',X'39',X'3A',X'3B',
  X'3C',X'3D',X'3E',X'3F',X'40',X'41',X'42',X'43',X'44',X'45',
  X'46',X'47',X'48',X'49',X'4A',X'4B',X'4C',X'4D',X'4E',X'4F',
  X'50',X'51',X'52',X'53',X'54',X'55',X'56',X'57',X'58',X'59',
  X'5A',X'5B',X'5C',X'5D',X'5E',X'5F',X'60',X'61',X'62',X'63',
  X'64',X'65',X'66',X'67',X'68',X'69',X'6A',X'6B',X'6C',X'6D',
  X'6E',X'6F',X'70',X'71',X'72',X'73',X'74',X'75',X'76',X'77',
  X'78',X'79',X'7A',X'7C',X'7D',X'7E',X'7F',X'80',X'81',
  X'82',X'83',X'84',X'85',X'86',X'87',X'88',X'89',X'8A',X'8B',
  X'8C',X'8D',X'8E',X'8F',X'90',X'91',X'92',X'93',X'94',X'95',
  X'96',X'97',X'98',X'99',X'9A',X'9B',X'9C',X'9D',X'9E',X'9F',
  X'A0',X'A1',X'A2',X'A3',X'A4',X'A5',X'A6',X'A7',X'A8',X'A9',
  X'AA',X'AB',X'AC',X'AD',X'AE',X'AF',X'B0',X'B1',X'B2',X'B3',
  X'B4',X'B5',X'B6',X'B7',X'B8',X'B9',X'BA',X'BB',X'BC',X'BD',
  X'BE',X'BF',X'C0',X'C1',X'C2',X'C3',X'C4',X'C5',X'C6',X'C7',
  X'C8',X'C9',X'CA',X'CB',X'CC',X'CD',X'CE',X'CF',X'D0',X'D1',
  X'D2',X'D3',X'D4',X'D5',X'D6',X'D7',X'D8',X'D9',X'DA',X'DB',
  X'DC',X'DD',X'DE',X'DF',X'E0',X'E1',X'E2',X'E3',X'E4',X'E5',
  X'E6',X'E7',X'E8',X'E9',X'EA',X'EB',X'EC',X'ED',X'EE',X'EF',
  X'F0',X'F1',X'F2',X'F3',X'F4',X'F5',X'F6',X'F7',X'F8',X'F9',
  X'FA',X'FB',X'FC',X'FD',X'FE',X'FF',
  X'FF'),
  OUT=C'                                           '),
  STARTPOS=your-known-starting-position of DSN,
  DO=1),


This will find a byte which matches the IN=( starting from STARTPOS, and then, once only (DO=1), change it to 44 spaces.

You'll need to amend the list above, since it has everything except a "#". So you need to remove everything that is valid in a DSN (letters, numbers, dots, and some other stuff).

This will work only if the byte immediately following the DSN is not valid to appear in a DSN, and if you don't need that byte for something else.

If you need data further up the record, which you didn't show being used, you just have to displace everything by 43 beyond the DSN.

You won't find it in a manual, because I made it up especially for you, between starting to write the previous post (where I thought you may get lucky with a constant value) and getting to the end of it, by which point I realised a known value wasn't needed :-)
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top