Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How can v update & delete a record from PS file in assem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Shilpa Joshi

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 12:25 pm    Post subject: How can v update & delete a record from PS file in assem
Reply with quote

Hi,

I am trying to update a record of a PS file, and in the previous posting of the same kind, they have suggested to use PUTX macro and GET macro in locate mode.

If i am trying to update empname based on empid, how do i rewrite the record in the same file.

Looking forward for some pointers. Thank you.
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2446
Location: Netherlands, Amstelveen

PostPosted: Fri Jun 22, 2012 12:39 pm    Post subject: Reply to: How can v update & delete a record from PS fil
Reply with quote

Search for "Updating in Place" in DFSMS Using Data Sets.
Back to top
View user's profile Send private message
Shilpa Joshi

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 1:57 pm    Post subject: Reply to: How can v update & delete a record from PS fil
Reply with quote

*********************************************
*OPEN THE FILE IN UPDATE MODE
*********************************************
OPEN (INFIL,UPDAT)
MAINLINE EQU *
GET INFIL,RECORD
MVC INREC,RECORD
CLC EMPID,CMPID
BE UPDATE
BNE NOUPDATE
*PUT THE RECORD IN TO THE OUTPUT FILE
*********************************************
UPDATE MVC EMPNAME,=CL6'SHILPU'
TPUT INREC,L'INREC
MVC RECORD,INREC
PUTX INFIL,RECORD
B MAINLINE
NOUPDATE B MAINLINE
*AT END OF FILE, CLOSE THE FILE
*********************************************
EOF CLOSE (INFIL)
***********STANDARD EXIT*********************
L 13,SAVEAREA+4
RETURN (14,12),RC=0
*********************************************
BR 14
SAVEAREA DS 18F
INFIL DCB DDNAME=INFILE,
MACRF=GM,
BLKSIZE=800,
LRECL=80,
RECFM=FB,
DSORG=PS,
EODAD=EOF
RECORD DS CL80
INREC DS 0CL80
EMPID DS CL6
EMPNAME DS CL20
DS CL54
CMPID DC CL6'E174751'
END FILEUPDT

No errors, when i run this code, but the file is not getting updated. Could you please tell me what changes has to be done to the code?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2446
Location: Netherlands, Amstelveen

PostPosted: Fri Jun 22, 2012 2:22 pm    Post subject:
Reply with quote

You can use GET and PUTX macros. To use PUTX, code MACRF=(GL,PL) on the DCB macro.

You didnt do that, so you didnt read the Updating in Place part of the manual.
Back to top
View user's profile Send private message
Shilpa Joshi

New User


Joined: 22 Jun 2012
Posts: 3
Location: India

PostPosted: Fri Jun 22, 2012 2:52 pm    Post subject: Reply to: How can v update & delete a record from PS fil
Reply with quote

I have changed MACRF=(GL,PL), no errors though, but nothing is getting updated in the file.

I read the updating in place, but they have used read and write. My mistake,that i didnt change MACRF to (GL,PL) in my earlier post.

Thank you.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Jun 22, 2012 6:45 pm    Post subject:
Reply with quote

Hello,

Do NOT multi-post the same question.

As mentioned in your other topic, it is bad design to overwrite records in a sequential file. Even if you find a way, it should NOT be used.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts Conversion of DLI update Jobs as BMP ... Gopinath Shanmugam IMS DB/DC 3 Wed Dec 20, 2017 12:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us