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

PRINTDS - I struggle with this one..


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

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Mon Apr 14, 2008 3:09 pm
Reply with quote

I'm running the TSO Utility PRINTDS like this:
Code:
//PRINTDS EXEC PGM=IKJEFT01                     
//SYSTSPRT DD SYSOUT=*                         
//SYSTSIN  DD *                                 
  PRINTDS DATASET('joblib-name') -   
    MEMBERS -                                   
    PAGELEN(26) -                               
    TODATASET('outputdsn')

The output from this utility is like this:
Code:

 DATA SET: joblib-name                                   MEMBER: member-name         
 DATE: 2008/04/14              TIME: 11:22                         PAGE:      1
                                                                               
//REPRO1   EXEC PGM=IDCAMS                                                     
//IND      DD  DSN=SICS.PROD.VSAM.V71.R48.D,DISP=SHR                           
//UD       DD  DSN=SICS.PROD.VSAM.V71.R48.D.OLD,DISP=SHR                       
//SYSPRINT DD SYSOUT=*                                                         
//SYSIN    DD *                                                               
           REPRO IFILE(IND) OFILE(UD)


Importent note on the output: If the size of the member (lines) is less than the defined PAGELEN (here 26 - most efficient on my site), blank linies are added. However, if the size member is greater than the PAGELEN, the header is repeated on every subsequent page.

My output must be:
Code:
JOBLIB(CHAR(44)) MEMBER(CHAR(8)) JCLLINE1(CHAR(80))
JOBLIB MEMBER JCLLINE2
etc.

Any help appreciated! Thanks icon_smile.gif
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Mon Apr 14, 2008 6:59 pm
Reply with quote

How about PAGELEN(999) so you only get another title when length of member exceeds 999?
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Mon Apr 14, 2008 9:16 pm
Reply with quote

Hi Bill,

Thanks for the suggestion, but... I'd end of with the same problem with members over 999 linies. Plus it'll generate way too much output on top of that.

I'm sure Frank or another SORT-developer can crack this nut... Right, guys? icon_wink.gif
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: Mon Apr 14, 2008 11:00 pm
Reply with quote

Quote:
I'm sure Frank or another SORT-developer can crack this nut... Right, guys?


Sorry, but I don't see how this PRINTDS question relates to SORT (I don't use PRINTDS so I'm not familiar with it). If you want me to help, you need to put this in DFSORT terms (example of input and expected output, "rules" for getting from input to output, LRECL and RECFM of input, etc).
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Apr 14, 2008 11:24 pm
Reply with quote

Claes Norreen,
It looks like you want to concatenate the dataset name and member name from the initial heading with the data line while ignoring any additional page headings.
But, if the additional page headings look like the initial heading, why should you bother to ignore them?
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue Apr 15, 2008 2:04 am
Reply with quote

Quote:
Sorry, but I don't see how this PRINTDS question relates to SORT

Well, no matter where the input comes from, it's still a question of input and output... I merely wrote "PRINTDS" in case you were familiar with the product.

In this particular case, PRINTDS dumps the content of a PDS into a flat dataset in the way I described: For each member, it writes a header (as shown), and the contents of that member follows. If the content of the member is shorter than the PAGELEN defined (here 26), it pads with blank lines to the PAGELEN. If the content of the member is longer than the PAGELEN, then the header is written again on each subsequent page.

I need a dataset with the name of the PDS, the name of the member along with the content for each member as output.

The "DATA SET:" identifier starts in column 2, and the "MEMBER:" identifier starts in column 58. The contents ifself starts in column 1 and is 100 bytes long.

Hope this helps?

/Claes
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue Apr 15, 2008 2:05 am
Reply with quote

CICS Guy wrote:
Claes Norreen,
It looks like you want to concatenate the dataset name and member name from the initial heading with the data line while ignoring any additional page headings.
But, if the additional page headings look like the initial heading, why should you bother to ignore them?

I'm not sure what your point is, CICS Guy?
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue Apr 15, 2008 2:11 am
Reply with quote

So the "rules" are: Grap the Dataset Name and the Member Name from the headers, and write it in front of every line of the contents of that particular Member.

Where Dataset Name is 44 chars wide, Member Name is 8 char, and the content the original 100 bytes.

The input is RECFM=FB, LRECL=100
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 15, 2008 2:25 am
Reply with quote

Hello Claes,

It may help if you post a more complete example of your output data.

Quote:
So the "rules" are: Grap the Dataset Name and the Member Name from the headers, and write it in front of every line of the contents of that particular Member.

Where Dataset Name is 44 chars wide, Member Name is 8 char, and the content the original 100 bytes.

The input is RECFM=FB, LRECL=100
It looks like the output would be at least 152? I may be missing someting. . .

Quote:
My output must be:
Code:
JOBLIB(CHAR(44)) MEMBER(CHAR(8)) JCLLINE1(CHAR(80))
JOBLIB MEMBER JCLLINE2
etc.
Does this meet the above "rule"?
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue Apr 15, 2008 3:54 am
Reply with quote

Yes, you are missing that "the content" is not the record in whole, but "the content" from the members involved...

Maybe I didn't explain it well enough, so here's the output from the example I show in my very first post (I use SYS2.JOBLIB as the name of the PDS or joblib-name, and TESTTEST as the member-name):
Code:
SYS2.JOBLIB                                 TESTTEST//REPRO1   EXEC PGM=IDCAMS
SYS2.JOBLIB                                 TESTTEST//IND      DD  DSN=SICS.PROD.VSAM.V71.R48.D,DISP=SHR                         
SYS2.JOBLIB                                 TESTTEST//UD       DD  DSN=SICS.PROD.VSAM.V71.R48.D.OLD,DISP=SHR                       
SYS2.JOBLIB                                 TESTTEST//SYSPRINT DD SYSOUT=*                                                         
SYS2.JOBLIB                                 TESTTEST//SYSIN    DD *                                                               
SYS2.JOBLIB                                 TESTTEST           REPRO IFILE(IND) OFILE(UD)

Hope that helps..?

Thanks,
/Claes

PS. Why was my thread moved? It's a DFSORT question, not a PRINTDS question.
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: Tue Apr 15, 2008 4:14 am
Reply with quote

Quote:
Why was my thread moved? It's a DFSORT question, not a PRINTDS question.


I moved it because I thought it was a PRINTDS question. I just moved it back.

But I still can't relate the output you showed in the previous post to "the example I show in my very first post", or figure out what you mean about the repeated header, so I can't help you. Maybe somebody else can (Kolusu might be able to help, but he's unavailable until the end of the week).
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 15, 2008 4:32 am
Reply with quote

Claes,

Please try to isolate an example of the printout (several small members) you expect and then hand craft what you want the final output to be for the input example you provided.

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 15, 2008 5:35 am
Reply with quote

Click icon_idea.gif

I believe the light just came on. . . I took a bit of liberty with the data to prevent "wrapping".

Sample input:
Code:
 DATA SET: joblib-name                                   MEMBER: member-name         
 DATE: 2008/04/14              TIME: 11:22                         PAGE:      1
                                                                               
//REPRO1   EXEC PGM=IDCAMS                                                     
//IND      DD DSN=SICS.PROD.VSAM,DISP=SHR                           
//UD       DD DSN=SICS.PROD.VSAM.OLD,DISP=SHR                       
//SYSPRINT DD SYSOUT=*                                                     
//SYSIN    DD *                                               
           REPRO IFILE(IND) OFILE(UD)



From that input, i believe this should be the Sample output (adjusting the actual positions to accomodate a full dsn):
Code:

SYS2.JOBLIB   TESTTEST//REPRO1   EXEC PGM=IDCAMS
SYS2.JOBLIB   TESTTEST//IND      DD DSN=SICS.PROD.VSAM,DISP=SHR                         
SYS2.JOBLIB   TESTTEST//UD       DD DSN=SICS.PROD.VSAM.OLD,DISP=SHR                       
SYS2.JOBLIB   TESTTEST//SYSPRINT DD SYSOUT=*                                                         
SYS2.JOBLIB   TESTTEST//SYSIN    DD *                                                               
SYS2.JOBLIB   TESTTEST           REPRO IFILE(IND) OFILE(UD)
The embedded blank lines in the output should not be there - using the reply/edit i've not been able to remove them. . . icon_evil.gif

A concern is that when a "member" on the input file has enough lines to exceed a page, the header info is repeated in the "input". I believe that simply skipping the "DATE" lines will eliminate the problem. I suspect that blank lines in the input should also be skipped.
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: Tue Apr 15, 2008 6:01 am
Reply with quote

Ok, I think I get it and I was able to create my own output using the PRINTDS utility. I suspect a group and SPLICE operation will give the desired results. It's quitting time here now. I'll see what I can do tomorrow.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 15, 2008 6:29 am
Reply with quote

Frank Yaeger wrote:
I suspect a group and SPLICE operation will give the desired results.
Frank, I know I have seen you provide this kind of solution, but for the life of me, I just couldn't think of how to search for it....
I back-tracked quite a few months back in your forum and nothing 'jumped' out...
For this kind of 'group and SPLICE' solution, what would be a good set of search keywords?
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue Apr 15, 2008 10:57 am
Reply with quote

Thank you for "clicking", gentlemen! icon_biggrin.gif

Looking forward to the solution.. icon_wink.gif By the way, Kolusu solved a similar one for me earlier, search for "LISTDS". I just couldn't adapt it to PRINTDS.
Extract certain output from LISTDS

/Claes
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: Tue Apr 15, 2008 10:08 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//OUT DD DSN=...  output file (FB/132)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(133,8,ZD) WITHALL WITH(53,80) USING(CTL1)
/*
//CTL1CNTL DD *
  OPTION COPY
  OMIT COND=(1,70,CH,EQ,C' ',OR,2,5,CH,EQ,C'DATE:')
  INREC IFTHEN=(WHEN=INIT,BUILD=(53:1,80,133:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(54,9,CH,EQ,C'DATA SET:'),
                OVERLAY=(1:64,44,45:118,8,133:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(141:SEQNUM,8,ZD,
                         133:133,8,ZD,SUB,141,8,ZD,TO=ZD,LENGTH=8))
  OUTFIL FNAMES=OUT,BUILD=(1,132)
/*
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Tue Apr 15, 2008 10:12 pm
Reply with quote

Wow, that look relatively simple! Looking forward to try it out tomorrow.

Thanks a lot, Frank.
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Wed Apr 16, 2008 11:14 am
Reply with quote

Just tested it, and it works excellent! icon_biggrin.gif Thanks again, Frank!
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

 


Search our Forums:

Back to Top