Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 2422
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: 2422
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us