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

Problem while converting TEXT to PDF conversion


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
acs_amit

New User


Joined: 30 Apr 2009
Posts: 14
Location: Noida

PostPosted: Thu May 14, 2009 6:44 pm
Reply with quote

Hi All,

I am getting a problem while trying to TXT to PDF conversion. When i do it using BATCH job.. I get the desired result. Here REPORT is input and PDFRPT is output and then i am encoding it using BASE64 and then mailing the PDF file.

Batch Code:

Code:
//* Send e-mail in pdf format                                           
//*                                                                     
//TSOBATCH EXEC PGM=IKJEFT01,                                           
//             PARM='TXT2PDF CONFIG DD:CONFIG'                         
//SYSEXEC  DD  DSN=BQ.W.ENDEVOR.BQCTI-S2.SRCLIB.REXX,                   
//    DISP=SHR                                                         
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSIN  DD DUMMY                                                     
//*REPORT   DD  DUMMY                                                   
//REPORT   DD DSN=BQ.W.TEST.CONN4X.ADCAJFBC.OUTPUT8,                   
//    DISP=SHR                                                         
//PDFRPT   DD DSN=&&PDFRPT,                                             
//    DISP=(NEW,PASS,DELETE),UNIT=SSORT,                               
//    SPACE=(CYL,(10,10),RLSE),                                         
//    DCB=(RECFM=VB,LRECL=4100,BLKSIZE=0)                               
//*                                                                     
//CONFIG   DD  *                                                       
IN dd:report OUT dd:pdfrpt                                             
IFEMPTY blank                                                         
ORIENT port                                                           
LM .2 TM .2 RM .2 BM .2                                               
PAPER 8.5x11/GrayBar                                                   
FONT 7/Courier/105                                                     
MAG FitWidth                                                           
*OLTOK "RECORD DESCRIPTION FOR RECORD"                                 
*OUTLINE "SC/2/24/15/RECORD DESCRIPTION FOR RECORD"                   
CC NO                                                                 
OUTLINE "SC/2/24/15/RECORD DESCRIPTION FOR RECORD"                     
*PAGE Outline/SinglePage                                               
*                                                                     
*OUTLINE "SC/2/24/15/RECORD DESCRIPTION FOR RECORD"                   
*OLTOK "/"                                                             
PAGE Outline/OneColumn                                                 
CONFIRM V                                                               
COMPRESS 9                                                             
*                                                                       
/*                                                                     
//*                                                                     



When i converted the same code in the REXX and ran the code.. there is some error. I am getting my PDF file but with no DATA.

REXX CODE:

Code:
"allocate ddname(systsprt) dataset(*)"                                 
"allocate ddname(systsin) dataset(DUMMY)"                               
"allocate ddname(sysprint) dataset(*)"                                 
                                                                       
email.attach.0 = 1                                                     
"allocate dataset('"||DSN.output||"') ddname(Report) shr"               
                                                                       
"allocate ",                                                           
        "dataset('"||DSN.Pdfrpt||"') ",                                 
        "ddname(pdfrpt) new catalog catalog ",                         
        "recfm(f) lrecl(4100) space(50,50) cylinders ",                 
        "dataclas(BQPODC) mgmtclas(BQNOACMC)"                           
                                                                       
"free ddname(sysout sysin)"                                             
"allocate ",                                                           
  "ddname(config) new catalog catalog ",                               
   "recfm(F) lrecl(80) space(10,10) cylinders ",                       
   "dataclas(BQPODC) mgmtclas(BQNOACMC)"  /* change dataclass and mgmt *
                                                                       
 "delstack"                                                             
                                                                       
 queue 'IN dd:report OUT dd:pdfrpt'                                     
 queue 'IFEMPTY blank'                                                 
 queue 'ORIENT port'                                                   
 queue 'LM .2 TM .2 RM .2 BM .2'                                       
 queue 'PAPER 8.5x11/GrayBar'                                           
 queue 'FONT 7/Courier/105'                                             
 queue 'MAG FitWidth'                                                   
 queue '*OLTOK "RECORD DESCRIPTION FOR RECORD"'                         
 queue '*OUTLINE "SC/2/24/15/RECORD DESCRIPTION FOR RECORD"'           
 queue 'CC NO'                                                         
 queue 'OUTLINE "SC/2/14/15/RECORD DESCRIPTION FOR RECORD"'             
queue '*PAGE Outline/SinglePage'                                       
queue '*'                                                               
queue '*OUTLINE "SC/2/24/15/RECORD DESCRIPTION FOR RECORD"'             
queue '*OLTOK "/"'                                                     
queue 'PAGE Outline/OneColumn'                                         
queue 'CONFIRM V'                                                       
queue 'COMPRESS 9'                                                     
queue '*'                                                               
                                                                       
"execio" queued() "diskw config (finis"                                 
                                                                       
"allocate ",                                                           
  "ddname(sysin) new catalog catalog ",                                 
  "recfm(F) lrecl(80) space(10,10) cylinders ",                         
  "dataclas(BQPODC) mgmtclas(BQNOACMC)"  /* change dataclass and mgmt */
                                                                       
                                                                       
 "delstack"                                                             
                                                                       
 queue 'TXT2PDF CONFIG DD:CONFIG'                                       
                                                                       
 "execio" queued() "diskw sysin (finis"                                 
                                                                       
 "call *(IKJEFT01)"                                                     
                                                                       
 "free ddname(sysin)"                                                   
                                                                       
 email.attach.1.dsn = DSN.pdfrpt                                       
 email.attach.1.localname = 'Copybook report '||run.Date||' '||         
   translate(run.Time,'.',':')||' '||SYSDATA.JOBNAME||' '||   ,         
   SYSDATA.JOBID||'.pdf'                                               
                                                                       
 call SendEmail                                                         
                                                                       
 return                                                                 



SYSTSPRT output of the job when i ran thru REXX:

Code:
                                                                               
TERMINAL  NOT ALLOCATED, FILE IN USE                                           
FILE SYSOUT NOT FREED, IS NOT ALLOCATED                                         
FILE SYSIN NOT FREED, IS NOT ALLOCATED                                         
   422 *-*  "call *(IKJEFT01)"                                                 
       +++ RC(-71) +++                                                         
NUMBER OF RECORDS PROCESSED WAS 18                                             
NUMBER OF RECORDS PROCESSED WAS 18                                             
NUMBER OF RECORDS PROCESSED WAS 6                                               



Can you help me where i have done the mistake .. and why this kind of error is coming..

pleaes let me know if you need any more info...
Thanks.
Back to top
View user's profile Send private message
acs_amit

New User


Joined: 30 Apr 2009
Posts: 14
Location: Noida

PostPosted: Thu May 14, 2009 6:50 pm
Reply with quote

In batch job.. 'TXT2PDF CONFIG DD:CONFIG' parameter were given in PARM and in REXX code, I have given them in SYSIN card..

Is this causing the error.. or something else..
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu May 14, 2009 7:16 pm
Reply with quote

acs_amit wrote:
When i do it using BATCH job.. I get the desired esult..


So, what's the problem exactly? I think we can presume that the TXT2PDF exec is good, right?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu May 14, 2009 7:16 pm
Reply with quote

You will need to read the code for TXT2PDF to see how it handles the parm input and then make changes to use SYSIN instead.
Back to top
View user's profile Send private message
acs_amit

New User


Joined: 30 Apr 2009
Posts: 14
Location: Noida

PostPosted: Thu May 14, 2009 7:31 pm
Reply with quote

Yes.. TXT2PDF exec is production exec.

Unfortunately I am not able to access TXT2PDF exec due to access problem. In batch job. PARM parameters takes 'TXT2PDF CONFIG DD:CONFIG' to identify input parameters.. and i have passed these parameters with SYSIN card..

My problem is just that if there is any coding error in REXX due to which PDF file is not generating OR
I have used SYSIN card. this may be not correct so Is there any other way to pass PARM fields in IKJEFT01 prog.. ?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 14, 2009 7:50 pm
Reply with quote

You are already under ikjeft01 control,

so You can simply issue an
Address TSO "TXT2PDF blah blah bla"

also systsin,sysprint,systsprt should already be allocated by the jcl invoking the batch IKJEFT01
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu May 14, 2009 9:28 pm
Reply with quote

Quote:
In batch job. PARM parameters takes 'TXT2PDF CONFIG DD:CONFIG' to identify input parameters.. and i have passed these parameters with SYSIN card..


TSO does not do anything with SYSIN. Perhaps SYSTSIN might work, but first try Enrico's advice.

Quote:
Unfortunately I am not able to access TXT2PDF exec due to access problem.

What access problems are you having? I do not believe there is a way to execute an exec without having at least READ authority to the dataset.
Back to top
View user's profile Send private message
acs_amit

New User


Joined: 30 Apr 2009
Posts: 14
Location: Noida

PostPosted: Fri May 15, 2009 1:49 pm
Reply with quote

Sorry for late reply..

PEDRO: I tried with Enrico's advice also but that also didn't work. You are right, i am having read access over TXT2PDF exec. Last time i mistakenly looked into someother exec that's why confusion created. Now i checked TXT2PDF exec.. it takes input as a string and then parsing that string.. Its not pulling records one by one.
I tried with SYSTSIN also...and reached one conclusion which i want to share with you to confirm if i am right..

Actually I am running my REXX macro thru IKJEFT01 prog in batch and passing some inputs thru SYSTSIN card. and now in that REXX macro itself, i ran TXT2PDF exec to convert output in PDF format. and i am trying to run TXT2PDF exec specifying in SYSTSIN card again using IKJEFT01 program. So my assumption is that my parent REXX macro is already using SYSTSIN card and again i am assigning values in SYSTSIN card to run IKJEFT01 (for TXT2PDF exec) while SYSTSIN card has not been freed that's why its not taking input and not converting input dataset in PDF format.

This is my JCL to run my main REXX Code:

Code:
//REXX001  EXEC PGM=IKJEFT01,DYNAMNBR=250                             
//SYSTSIN  DD DISP=(OLD,PASS,DELETE),DSN=&&SYSTSIN                     
//*                                                                   *
//SYSPROC  DD DUMMY                                                   
//SYSEXEC  DD DISP=(OLD,PASS,DELETE),DSN=&&SYSEXEC                     
//         DD DISP=SHR,DSN=BQ.W.ENDEVOR.BQCTI-S2.SRCLIB.REXX           
//SYSEXECF DD DISP=(OLD,PASS,DELETE),DSN=&&SYSEXECF                   
//ISPPROF  DD DISP=(SHR,PASS,DELETE),DSN=&&ISPROF                     
//SYSTCPD  DD DISP=SHR,DSN=SYS1.TCPIP.PARMLIB1(TCPDATA)               
//SYSFTPD  DD DISP=SHR,DSN=SYS1.TCPIP.PARMLIB1(FTPDATA)               
//SYSTSPRT DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSTERM  DD SYSOUT=*                                                 


Here i am passing some parameters thru SYSTSIN card in rexx macro.. and SYSTSIN card is defined as OLD. so probably it creates some kind of lock. I don't know more but it may be..

I am getting error in SYSTPRT card like this..

Code:
  FILE SYSTSIN NOT FREED, DATA SET IS OPEN                                   
 DATA SET BQ.W.TEST.CONN4X.ADCAJFBC.SYSTSIN NOT ALLOCATED, FILE IN USE       
    428 *-*  "call *(IKJEFT01)"                                             
        +++ RC(-71) +++                                                     
  FILE SYSTSIN NOT FREED, DATA SET IS OPEN                                   


I have tried multiple option and not getting any solution... bt still thinking that there must be solution for this.. I don't want to lose my hope before i go for last solution of running TXT2PDF in batch only.

I can run it in BATCH mode also but you know it won't look good. Actually i need to send 3 confirmation mails. first to indicate user that your job has been started then 2nd mail with output created and 3rd for confirmation of completion of the job. Now i am sending 1st mail thru REXX macro and if i do the PDF conversion in BATCH instead of REXX, then i will have to send 2nd and 3rd mail also thru batch only.

I hope, i have not confused you guys.. Thanks for your replies.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri May 15, 2009 9:22 pm
Reply with quote

Quote:
I tried with Enrico's advice also but that also didn't work.

Actually, that is the preferred method. Please show us what you tried and what error messages you get.


In your non-preferred example, You did not show us the contents of SYSTSIN. It is the most important part. But you already looked at the exec and concluded that it does not read records from SYSIN nor from SYSTSIN... why are you continuing to try something that you know will not work.
Back to top
View user's profile Send private message
acs_amit

New User


Joined: 30 Apr 2009
Posts: 14
Location: Noida

PostPosted: Fri May 15, 2009 9:47 pm
Reply with quote

you are right. I have left the idea of using SYSTSIN which is not working.

I found another solution to get my objective achieved.

Currently I was able to convert txt to PDF in batch job.. so i have just coded all those JOB lines in a dataset. and then submitted that job using TSO SUBMIT..

I know this is not preferrable method too and i don't know whether it will be approved by my seniors. bt for now I am able to get my report in PDF format.

I will let you know the error which i got with Enrico's solution on Monday as now i am at my room without mainframe connectivity.

Thanks Pedro..
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Fri May 15, 2009 11:07 pm
Reply with quote

You are already running IKJEFT01. You can not start IKJEFT01 inside of IKJEFT01. If you need to run TSO commands, just run them. You are already in TSO.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top