Need to create PDS member and write the lines in each member

IBM's Command List programming language & Restructured Extended Executor
arya_starc
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Skillset: VSAM,CICS,JCL,COBOL
Referer: INTERENT

Need to create PDS member and write the lines in each member

Postby arya_starc » Sat Mar 16, 2019 10:07 pm

Hi All,

I am writing a rexx in which new member is allocated and in each member I am writing few line of code, all this had been done in single rexx.
Issue that I am facing first member lines are being override in consecutive member, Below is the code:-

Code: Select all


/* REXX */
PDS = "XYZ.TEST.IN"
PDS4 = "ABC.TEST.OUT"
pds1 = pds || "("||MAINPROC||")"
"ALLOC FI(PDS1) DA('"PDS1"') SHR REUSE"
"EXECIO * DISKR PDS1 (STEM PROC1. FINIS"
"FREE FI(PDS1)"
SAY 'ENTER NUMBER OF MEMBER'
PULL NOM
DO P=1 TO NOM
      SAY 'ENTER MEMBER NAME'
      PULL  NEWMWMB
      SAY 'ENTER LINES TO BE COPIED'
      PULL LINE
      pds2 = pds4 || "("||newmemb||")"
      "ALLOC FI(PDS2) DA('"PDS2"') SHR REUSE"
DO J=1 TO LINE
     PROCO.J = PROC1.J
     "execio * diskw pds2(stem proco.finis")
END
END
EXIT
 


This issue somewhere related to while allocation of new member.Kindly help me on this.
Thanks in advacnce.

User avatar
prino
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
Referer: Google
Location: Vilnius, Lithuania
Contact:

Re: Need to create PDS member and write the lines in each me

Postby prino » Sat Mar 16, 2019 11:34 pm

Add "trace ?r" to your code and execute it step by step!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy

arya_starc
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Skillset: VSAM,CICS,JCL,COBOL
Referer: INTERENT

Re: Need to create PDS member and write the lines in each me

Postby arya_starc » Sun Mar 17, 2019 1:51 pm

Hi Prino

I tried with "trace ?r" but I can see that loop is running correctly but whwn I see the output in member the number of lines in each member is incorrectly.
Please advise on that.

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

Re: Need to create PDS member and write the lines in each me

Postby NicC » Sun Mar 17, 2019 4:47 pm

Why are you closing pds2 after EVERY write? Why are you creating a stem but only writing one line at a time? I could go on but...
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

enrico-sorichetti
Global moderator
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
Referer: www.ibmmainframes.com

Re: Need to create PDS member and write the lines in each me

Postby enrico-sorichetti » Sun Mar 17, 2019 6:39 pm

since You write only the first <line> lines

instead of

Code: Select all

DO J=1 TO LINE
     PROCO.J = PROC1.J
     "execio * diskw pds2(stem proco.finis")
END
 


use

Code: Select all

"execio" line "diskw pds2 (stem proc1. finis "
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

Re: Need to create PDS member and write the lines in each me

Postby willy jensen » Tue Mar 19, 2019 3:11 pm

Is MAINPROC the name of the input memer, you are using it as a ariable?
Does the input member contain null lines? That will cause EXECIO * DISKW to stop. Always use a number instead of the asterix in DISKW.


  • Similar Topics
    Replies
    Views
    Last post