Reputation: 354
i'm writing a rexx script on a z/OS (ADCD version) at my university. I want to write a very long string to a pds member with diskw. Sadly rexx doesn't automaticly break the line so only about half the string is written to the member. My string is a command that i am concatenating, executing and that i want to write to a log.
/*REXX*/
"ALLOCATE DATASET('"FILEPATH"') FILE(FILE) SHR REUSE"
command = "adduser" username
command = command || " TSO(ACCTNUM(ACCT) PROC(DBSPROC)",
"MAXSIZE(6072) SIZE(5000) MSGCLASS(H) UNIT(SYSALLDA))"
LOG.1 = command
LOG.2 = "Other Stuff"
"EXECIO" 2 "DISKW FILE (STEM LOG."
"EXECIO 0 DISKW FILE (FINIS"
"FREE FILE(FILE)"
The Log created now only contains my command to a certain character and the rest of my command is not written to the member. like this:
adduser john TSO(ACCTNUM(ACCT) PROC(DBSPROC) MAXSIZE(6072) SIZE(5
Do you have any idea how to make rexx break the line and write my whole command?
Upvotes: 1
Views: 1539
Reputation: 11
The ALLOCATE in your example is for an existing dataset. If you want to create a new output dataset with much longer lines (as Joseph suggested) it needs to be a different dataset, and the ALLOCATE will need changed to point to the new file not the old one.
Also it's possible that despite asking for a file with RECFM(V) or VB etc that's not what the system actually created. You need to make sure that the output file really does have a long LRECL before you try to use it. Some systems may override what you ask for and create 80 byte record files (using what's known as SMS rules).
Upvotes: 0
Reputation: 11
Define the log file as recfm(v) lrecl(32100) block(32108) , or (vb) where the lrecl is the expected maximum record length.
Write to it as follows:
push command
"EXECIO 1 DISKW FILE"
push "other stuff"
"EXECIO 1 DISKW FILE"
Upvotes: 0